[英]firebase: how to link email verification and password
I already authenticate user with email and password, but I want to add email link verification using firebase in react native. 我已经使用电子邮件和密码对用户进行身份验证,但是我想在React Native中使用Firebase添加电子邮件链接验证。
So, user have to provide right email address that he/she owned and password, how can I link them or create it. 因此,用户必须提供他/她拥有的正确的电子邮件地址和密码,如何链接或创建它们。
This is my code for signup: 这是我的注册代码:
export const signupUser = ({firstName, lastName, userName, email, password}) => async dispatch => {
dispatch({ type: SIGNUP_SPINNER });
try {
let user = await firebase.auth().createUserWithEmailAndPassword(email, password);
if(user) {
const { currentUser } = firebase.auth();
// add displayName
await currentUser.updateProfile({
displayName: `${firstName} ${lastName}`
});
await firebase.database().ref(`/users/${currentUser.uid}/profile`)
.push({firstName, lastName, userName, email})
.then(async () => {
dispatch({ type: SIGNUP_INITIAL_STATE });
});
}
} catch(err) {
dispatch({ type: SIGNUP_USER_FAIL, payload: 'something went wrong, please try again!!!' });
}
}
The email verification could be done in several ways in mobile apps: 电子邮件验证可以在移动应用程序中以多种方式完成:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.