Files
website/internal/http/routes/accountroutes.go

25 lines
727 B
Go

package routes
import (
accountHandlers "synlotto-website/internal/handlers/account"
"synlotto-website/internal/http/middleware"
"synlotto-website/internal/platform/bootstrap"
)
func RegisterAccountRoutes(app *bootstrap.App) {
r := app.Router
acc := r.Group("/account")
acc.GET("/login", accountHandlers.LoginGet)
acc.POST("/login", accountHandlers.LoginPost)
acc.GET("/signup", accountHandlers.SignupGet)
acc.POST("/signup", accountHandlers.SignupPost)
// Protected logout
accAuth := r.Group("/account")
accAuth.Use(middleware.AuthMiddleware(), middleware.RequireAuth())
accAuth.POST("/logout", accountHandlers.Logout)
accAuth.GET("/logout", accountHandlers.Logout) //ToDo: keep if you still support GET?
}