add middleware for api

This commit is contained in:
Adrian Zürcher
2025-10-24 16:29:37 +02:00
parent 14994edcad
commit 8285cf0384
4 changed files with 170 additions and 10 deletions

View File

@@ -112,7 +112,7 @@ func TestLoginHandler(t *testing.T) {
r.POST("/login/refresh", aH.Refresh)
r.GET("/login/me", aH.Me)
r.GET("/logout", aH.Logout)
middleware := r.Group("", AuthMiddleware())
middleware := r.Group("", aH.AuthMiddleware())
auth := middleware.Group("/members", aH.AuthorizeRole(""))
auth.GET("", func(ctx *gin.Context) {