Created
January 8, 2021 15:00
-
-
Save Mbbahar/3518e6633cb4e868a96e37997b931149 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
import auth from "@react-native-firebase/auth" | |
... | |
const __doSignUp = () => { | |
if (!UserEmail) { | |
Alert.alert('Error',"Email required *") | |
return | |
} else if (!UserPassword && UserPassword.trim() && UserPassword.length > 6) { | |
Alert.alert('Error',"Weak password, minimum 6 chars") | |
return | |
} else { | |
__doCreateUser(UserEmail, UserPassword) | |
return | |
} | |
} | |
const __doCreateUser = async () => { | |
try { | |
let response = await auth().createUserWithEmailAndPassword(UserEmail, UserPassword) | |
if (response) { | |
console.log(response) | |
Alert.alert('Welcome Message','Welcome the App'); | |
} | |
} catch (e) { | |
console.error(e.message) | |
} | |
} | |
... | |
onPress={() => __doSignUp()} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment