Fall back to using sub if email is none (as in PR #57)
This commit is contained in:
parent
79acef9036
commit
58b06ce761
@ -901,6 +901,7 @@ func (p *OAuthProxy) GetJwtSession(req *http.Request) (*sessionsapi.SessionState
|
|||||||
}
|
}
|
||||||
|
|
||||||
var claims struct {
|
var claims struct {
|
||||||
|
Subject string `json:"sub"`
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
Verified *bool `json:"email_verified"`
|
Verified *bool `json:"email_verified"`
|
||||||
}
|
}
|
||||||
@ -910,7 +911,7 @@ func (p *OAuthProxy) GetJwtSession(req *http.Request) (*sessionsapi.SessionState
|
|||||||
}
|
}
|
||||||
|
|
||||||
if claims.Email == "" {
|
if claims.Email == "" {
|
||||||
return nil, fmt.Errorf("id_token did not contain an email")
|
claims.Email = claims.Subject
|
||||||
}
|
}
|
||||||
|
|
||||||
if claims.Verified != nil && !*claims.Verified {
|
if claims.Verified != nil && !*claims.Verified {
|
||||||
|
Loading…
Reference in New Issue
Block a user