Reputation: 1658
According to the document, it is possible to have email verified when user().onCreate is triggered. From my understanding, you can send email verification link only after creating an account. How it is possible?
// On sign up.
exports.processSignUp = functions.auth.user().onCreate(async (user) => {
// Check if user meets role criteria.
if (
user.email &&
user.email.endsWith('@admin.example.com') &&
user.emailVerified // Is this can be true at this moment!?
) {
// Grant access
} catch (error) {
console.log(error);
}
}
});
Upvotes: 0
Views: 93
Reputation: 599131
The initial claims for a user profile are determined by the provider that creates the initial ID token for that user. So any provider can set the emailVerified
claim if they want.
Example of built-in providers that do that:
emailVerified
is set to true
.@gmail.com
and Facebook for @facebook.com
addresses, and may set emailVerified
to true
for such addresses automatically.Upvotes: 1