Commit db654088 by Tonk

update send verification mail

parent 4d181631
...@@ -43,18 +43,24 @@ class RegisterScreen extends Component { ...@@ -43,18 +43,24 @@ class RegisterScreen extends Component {
createAccount = async values => { createAccount = async values => {
const userData = { firstName: values.firstName, lastName: values.lastName, phoneNumber: values.phoneno }; const userData = { firstName: values.firstName, lastName: values.lastName, phoneNumber: values.phoneno };
try { try {
const reg = app app.auth()
.auth()
.createUserWithEmailAndPassword(values.email, values.password) .createUserWithEmailAndPassword(values.email, values.password)
.then(async value => { .then(async value => {
this.sendEmail();
await this.props.getCurrentUser(value); await this.props.getCurrentUser(value);
await this.props.updateUser(userData); await this.props.updateUser(userData);
}); });
if (reg) {
app.auth().signOut();
this.props.navigation.navigate('Success'); this.props.navigation.navigate('Success');
} catch (error) {
alert(error);
} }
};
sendEmail = async () => {
const user = app.auth().currentUser;
try {
await user.sendEmailVerification().then(() => {
app.auth().signOut();
});
} catch (error) { } catch (error) {
alert(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