remove unused user registration code
Some checks failed
Build and Deploy ytdlp-site / build-deploy (push) Has been cancelled
Some checks failed
Build and Deploy ytdlp-site / build-deploy (push) Has been cancelled
Signed-off-by: Carl Pearson <me@carlpearson.net>
This commit is contained in:
2
go.mod
2
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
|
||||
)
|
||||
|
18
handlers.go
18
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 {
|
||||
|
2
main.go
2
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)
|
||||
|
Reference in New Issue
Block a user