Use less deep nesting
Co-authored-by: Jan Larwig <jan@larwig.com>
This commit is contained in:
parent
4fb6043b04
commit
919d491cdc
|
|
@ -66,10 +66,9 @@ func (p *CIDAASProvider) RefreshSession(ctx context.Context, s *sessions.Session
|
||||||
|
|
||||||
// EnrichSession data to add email an groups
|
// EnrichSession data to add email an groups
|
||||||
func (p *CIDAASProvider) EnrichSession(ctx context.Context, s *sessions.SessionState) error {
|
func (p *CIDAASProvider) EnrichSession(ctx context.Context, s *sessions.SessionState) error {
|
||||||
if p.ProfileURL.String() == "" {
|
if p.ProfileURL.String() == "" && s.Email == "" {
|
||||||
if s.Email == "" {
|
|
||||||
return errors.New("id_token did not contain an email and profileURL is not defined")
|
return errors.New("id_token did not contain an email and profileURL is not defined")
|
||||||
}
|
} else if p.ProfileURL.String() == "" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue