You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-29 22:01:14 +03:00
Make the email verification state more configurable on upstream OAuth 2.0 registration
This also marks the email as primary
This commit is contained in:
@ -527,11 +527,19 @@ pub(crate) async fn post(
|
||||
.add(&mut rng, &clock, &user, email)
|
||||
.await?;
|
||||
|
||||
// Mark the email as verified if the upstream provider says it is.
|
||||
if payload.email_verified {
|
||||
repo.user_email()
|
||||
// Mark the email as verified according to the policy and whether the provider
|
||||
// claims it is, and make it the primary email.
|
||||
if provider
|
||||
.claims_imports
|
||||
.verify_email
|
||||
.should_mark_as_verified(payload.email_verified)
|
||||
{
|
||||
let user_email = repo
|
||||
.user_email()
|
||||
.mark_as_verified(&clock, user_email)
|
||||
.await?;
|
||||
|
||||
repo.user_email().set_as_primary(&user_email).await?;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user