chore: revert some fixes, make it work with stubs as well

This commit is contained in:
janishutz committed 2026-09-28 11:56:19 +02:00
1 parent bb548cc2c3
commit 58855ed3a2
2 files changed
+14 -22

No files matched your search

+7 -1
View File
@@ -7,9 +7,15 @@ import (
"github.com/gin-gonic/gin"
)
func startStubs(r *gin.Engine) {
func startStubs(r *gin.Engine, check_middleware func(c *gin.Context)) {
r.GET("/auth/v2/login", stubsHandler)
r.GET("/auth/v2/verify", stubsHandler)
if check_middleware == nil {
r.GET("/auth/v2/check", EnsureLogin(false), check_finalizer)
} else {
log.Println("[JHID] Custom check middleware enabled")
r.GET("/auth/v2/check", EnsureLogin(false), check_middleware, check_finalizer)
}
r.GET("/auth/v2/check", EnsureLogin(false), func(ctx *gin.Context) { ctx.JSON(200, gin.H{"success": "true"}) })
r.GET("/auth/v2/logout", logoutHandler)
}