feat: get user table

This commit is contained in:
2025-11-09 23:12:51 -07:00
parent 5862378dc1
commit 3ca80e7650
5 changed files with 73 additions and 3 deletions

View File

@@ -62,9 +62,9 @@ func main() {
router.GET("/auth/logout", auth.LogoutHandler)
router.GET("/auth/logout_callback", auth.LogoutCallbackHandler(store))
router.GET("/callback", auth.AuthenticationCallbackHandler(authenticator))
router.GET("/public", controllers.PublicEndpoint)
router.GET("/users", middleware.IsAuthenticated(authenticator), middleware.GetUserProfile, middleware.UserInDatabase(pool), middleware.UserIsActive(pool), middleware.IsAdmin(pool), controllers.GetUserTable(pool))
router.POST("/user/create", middleware.IsAuthenticated(authenticator), middleware.GetUserProfile, middleware.UserInDatabase(pool), middleware.UserIsActive(pool), controllers.CreateUser(pool))
router.POST("/user/name", middleware.IsAuthenticated(authenticator), middleware.GetUserProfile, middleware.UserInDatabase(pool), middleware.UserIsActive(pool), controllers.SetUserName(pool))
router.PUT("/user/promote", middleware.IsAuthenticated(authenticator), middleware.GetUserProfile, middleware.UserInDatabase(pool), middleware.UserIsActive(pool), middleware.IsAdmin(pool), controllers.PromoteUser(pool))
router.PUT("/user/demote", middleware.IsAuthenticated(authenticator), middleware.GetUserProfile, middleware.UserInDatabase(pool), middleware.UserIsActive(pool), middleware.IsAdmin(pool), controllers.DemoteUser(pool))