From 18d640ab1f49a73a7723ce9fe876358432224fd2 Mon Sep 17 00:00:00 2001 From: Carl Pearson Date: Mon, 6 Oct 2025 05:40:48 -0600 Subject: [PATCH] remove unused user registration code Signed-off-by: Carl Pearson --- go.mod | 2 +- handlers.go | 18 ------------------ main.go | 2 -- 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/go.mod b/go.mod index a174c80..04fbefb 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/labstack/echo/v4 v4.10.2 github.com/sirupsen/logrus v1.9.3 golang.org/x/crypto v0.9.0 + golang.org/x/sys v0.8.0 gorm.io/driver/sqlite v1.5.1 gorm.io/gorm v1.25.1 ) @@ -26,7 +27,6 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/time v0.3.0 // indirect ) diff --git a/handlers.go b/handlers.go index 0310b31..11fbc75 100644 --- a/handlers.go +++ b/handlers.go @@ -22,7 +22,6 @@ import ( "ytdlp-site/originals" "ytdlp-site/playlists" "ytdlp-site/transcodes" - "ytdlp-site/users" "ytdlp-site/ytdlp" ) @@ -36,23 +35,6 @@ type DisplayVideoClip struct { Stop string } -func registerHandler(c echo.Context) error { - return c.Render(http.StatusOK, "register.html", nil) -} - -func registerPostHandler(c echo.Context) error { - username := c.FormValue("username") - password := c.FormValue("password") - - err := users.Create(db, username, password) - - if err != nil { - return c.String(http.StatusInternalServerError, "Error creating user") - } - - return c.Redirect(http.StatusSeeOther, "/login") -} - func homeHandler(c echo.Context) error { _, err := handlers.GetUser(c) if err != nil { diff --git a/main.go b/main.go index 2ef4da7..02675b4 100644 --- a/main.go +++ b/main.go @@ -132,8 +132,6 @@ func main() { e.GET("/", homeHandler) e.GET("/login", handlers.LoginGet) e.POST("/login", handlers.LoginPost) - // e.GET("/register", registerHandler) - // e.POST("/register", registerPostHandler) e.GET("/logout", handlers.LogoutGet) e.GET("/download", downloadHandler, handlers.AuthMiddleware) e.POST("/download", downloadPostHandler, handlers.AuthMiddleware)