mirror of
https://github.com/yusing/godoxy.git
synced 2025-06-01 01:22:34 +02:00
fix(oidc): restore old user matching behavior
This commit is contained in:
parent
f0ab14cb1e
commit
82ee75daab
1 changed files with 4 additions and 3 deletions
|
@ -201,11 +201,12 @@ func parseClaims(idToken *oidc.IDToken) (*IDTokenClaims, error) {
|
||||||
|
|
||||||
func (auth *OIDCProvider) checkAllowed(user string, groups []string) bool {
|
func (auth *OIDCProvider) checkAllowed(user string, groups []string) bool {
|
||||||
userAllowed := slices.Contains(auth.allowedUsers, user)
|
userAllowed := slices.Contains(auth.allowedUsers, user)
|
||||||
if !userAllowed {
|
if userAllowed {
|
||||||
return false
|
return true
|
||||||
}
|
}
|
||||||
if len(auth.allowedGroups) == 0 {
|
if len(auth.allowedGroups) == 0 {
|
||||||
return true
|
// user is not allowed, but no groups are allowed
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
return len(utils.Intersect(groups, auth.allowedGroups)) > 0
|
return len(utils.Intersect(groups, auth.allowedGroups)) > 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue