简体   繁体   English

Firebase 仪表板组 email 已验证

[英]Firebase Dashboard set email verified

I created a user via the console and inside my client (iOS App) I require the user to have their email verified before they can use it.我通过控制台和我的客户端(iOS App)创建了一个用户,我要求用户在使用之前验证他们的 email。 However the test user does not have a valid email (it does not exist).但是,测试用户没有有效的 email(它不存在)。 The email is testing@project-name.com . email 是testing@project-name.com

Is there any way I can set the account as "verified email"?有什么办法可以将帐户设置为“经过验证的电子邮件”吗? I don't find anything in the console, is it possible to set this status on a user (maybe in a onCreate auth trigger?)?我在控制台中找不到任何东西,是否可以在用户上设置此状态(也许在 onCreate 身份验证触发器中?)?

Thank you谢谢

There is no option in the Firebase Console to set the emailVerified state of a user. Firebase控制台中没有选项来设置用户的emailVerified状态。 So you'll have to do it in code. 因此,您必须在代码中执行此操作。

The easiest way to do this is through the Firebase Admin SDK, which is available for Node.js, Java, Python and Go. 最简单的方法是通过Firebase Admin SDK,该软件可用于Node.js,Java,Python和Go。 In Node.js it's as simple as: 在Node.js中,它很简单:

admin.auth().updateUser(uid, { emailVerified: true })

You can find the user's UID in the Firebase console. 您可以在Firebase控制台中找到用户的UID。

adding for laravel-firebase SDK:添加 laravel-firebase SDK:

app('firebase.auth')->updateUser($uid, [ 'emailVerified' => true ]);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM