Authn: allow ResolveIdentity to authenticate in "global" scope (#85835)
* Authn: allow ResolveIdentity to authenticate in "global" scope * Use constant
This commit is contained in:
@@ -132,6 +132,13 @@ func (s *UserSync) FetchSyncedUserHook(ctx context.Context, identity *authn.Iden
|
||||
return errFetchingSignedInUser.Errorf("failed to resolve user: %w", err)
|
||||
}
|
||||
|
||||
if identity.ClientParams.AllowGlobalOrg && identity.OrgID == authn.GlobalOrgID {
|
||||
usr.Teams = nil
|
||||
usr.OrgName = ""
|
||||
usr.OrgRole = org.RoleNone
|
||||
usr.OrgID = authn.GlobalOrgID
|
||||
}
|
||||
|
||||
syncSignedInUserToIdentity(usr, identity)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user