add a block page to oidc on invallid credentials, fix inifinite login redirect

This commit is contained in:
yusing
2025-02-27 01:18:47 +08:00
parent 485aa0f52b
commit a4d99b54af
5 changed files with 52 additions and 8 deletions

View File

@@ -132,7 +132,7 @@ func (auth *OIDCProvider) CheckToken(r *http.Request) error {
allowedUser := slices.Contains(auth.allowedUsers, claims.Username)
allowedGroup := len(CE.Intersect(claims.Groups, auth.allowedGroups)) > 0
if !allowedUser && !allowedGroup {
return ErrUserNotAllowed.Subject(claims.Username)
return ErrUserNotAllowed
}
return nil
}