fix: Optionally consume email_verified if it's provided (#3957)

This reduces our OIDC requirement claims to only `email`. If `email_verified`
is provided and is `false`, we will block authentication.

Fixes #3954.
This commit is contained in:
Kyle Carberry
2022-09-08 09:06:00 -05:00
committed by GitHub
parent bb4a681833
commit e1afec6db4
2 changed files with 49 additions and 20 deletions

View File

@ -302,11 +302,20 @@ func TestUserOIDC(t *testing.T) {
AvatarURL string
StatusCode int
}{{
Name: "EmailNotVerified",
Name: "EmailOnly",
Claims: jwt.MapClaims{
"email": "kyle@kwc.io",
},
AllowSignups: true,
StatusCode: http.StatusTemporaryRedirect,
Username: "kyle",
}, {
Name: "EmailNotVerified",
Claims: jwt.MapClaims{
"email": "kyle@kwc.io",
"email_verified": false,
},
AllowSignups: true,
StatusCode: http.StatusForbidden,
}, {
Name: "NotInRequiredEmailDomain",