Skip to content

Instantly share code, notes, and snippets.

@Mbbahar
Created January 8, 2021 15:00
Show Gist options
  • Save Mbbahar/3518e6633cb4e868a96e37997b931149 to your computer and use it in GitHub Desktop.
Save Mbbahar/3518e6633cb4e868a96e37997b931149 to your computer and use it in GitHub Desktop.
...
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