Commit db654088 by Tonk

update send verification mail

parent 4d181631
......@@ -43,18 +43,24 @@ class RegisterScreen extends Component {
createAccount = async values => {
const userData = { firstName: values.firstName, lastName: values.lastName, phoneNumber: values.phoneno };
try {
const reg = app
.auth()
app.auth()
.createUserWithEmailAndPassword(values.email, values.password)
.then(async value => {
this.sendEmail();
await this.props.getCurrentUser(value);
await this.props.updateUser(userData);
});
if (reg) {
this.props.navigation.navigate('Success');
} catch (error) {
alert(error);
}
};
sendEmail = async () => {
const user = app.auth().currentUser;
try {
await user.sendEmailVerification().then(() => {
app.auth().signOut();
this.props.navigation.navigate('Success');
}
});
} catch (error) {
alert(error);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment