[英]Email verification before user creation
According to the document , it is possible to have email verified when user().onCreate is triggered.根据文档,触发 user().onCreate 时可以验证 email。 From my understanding, you can send email verification link only after creating an account.
据我了解,您必须在创建帐户后才能发送 email 验证链接。 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);
}
}
});
The initial claims for a user profile are determined by the provider that creates the initial ID token for that user.用户配置文件的初始声明由为该用户创建初始 ID 令牌的提供者确定。 So any provider can set the
emailVerified
claim if they want.因此,任何提供商都可以根据需要设置
emailVerified
声明。
Example of built-in providers that do that:执行此操作的内置提供程序示例:
emailVerified
is set to true
.emailVerified
设置为true
。@gmail.com
and Facebook for @facebook.com
addresses, and may set emailVerified
to true
for such addresses automatically.@gmail.com
和 Facebook 拥有@facebook.com
地址,并且可能会自动将此类地址的emailVerified
设置为true
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.