feat: option to force authorization for vistor routes (#971)

This commit is contained in:
UUBulb
2025-01-29 19:27:57 +08:00
committed by GitHub
parent 9581690518
commit a5b7db10e1
3 changed files with 13 additions and 8 deletions

View File

@@ -148,7 +148,7 @@ func refreshResponse(c *gin.Context, code int, token string, expire time.Time) {
})
}
func optionalAuthMiddleware(mw *jwt.GinJWTMiddleware) func(c *gin.Context) {
func fallbackAuthMiddleware(mw *jwt.GinJWTMiddleware) func(c *gin.Context) {
return func(c *gin.Context) {
claims, err := mw.GetClaimsFromJWT(c)
if err != nil {