routes: add extra handling for signin/signup
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2023-08-12 14:50:49 +02:00
parent 1106359a3e
commit e7be74d1eb
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI

@ -56,6 +56,14 @@ func (a *App) SetupRoutes() error {
e.POST("/signup", handlers.SignupPost(a.db)) e.POST("/signup", handlers.SignupPost(a.db))
e.GET("/home", handlers.Home(a.db), compress) e.GET("/home", handlers.Home(a.db), compress)
// handle weird attempts here.
e.POST("/signin/*", func(c echo.Context) error {
return c.NoContent(http.StatusNotFound)
})
e.POST("/signup/*", func(c echo.Context) error {
return c.NoContent(http.StatusNotFound)
})
e.GET("/manage/api-keys", handlers.ManageAPIKeys(), handlers.MiddlewareSession) e.GET("/manage/api-keys", handlers.ManageAPIKeys(), handlers.MiddlewareSession)
e.GET("/manage/users", handlers.ManageUsers(), handlers.MiddlewareSession) e.GET("/manage/users", handlers.ManageUsers(), handlers.MiddlewareSession)
e.GET("/manage/users/new", handlers.ManageUsers(), handlers.MiddlewareSession) e.GET("/manage/users/new", handlers.ManageUsers(), handlers.MiddlewareSession)