mirror of
https://github.com/janishutz/oidclogin.git
synced 2026-10-08 17:26:20 +02:00
chore: revert some fixes, make it work with stubs as well
This commit is contained in:
1 parent
bb548cc2c3
commit
58855ed3a2
2 files changed
+14
-22
No files matched your search
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user