We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
handler code:
const handleEmailVerification = (user) => { console.log("email verification sent") console.log(user); if (user) user.sendEmailVerification() .then(_ => alert(`Email Verification is sent to ${email}`)) .catch(error => alert(error.message)) else alert("User is null") } const handleDeleteUser = () => { const {user} = auth.currentUser if (user) { user.delete() console.log(`delete account ${email}`) return } auth .signInWithEmailAndPassword(email, password) .then(userCredentials => { const user = userCredentials.user; // console.log('Logged in with:', user.email); user.delete(); console.log(`delete account ${email}`) }) .catch(error => alert(error.message)) // console.log(auth.currentUser) } const handle# = () => { const {user} = auth .createUserWithEmailAndPassword(email, password) .then(userCredentials => { const user = userCredentials.user; console.log('Registered with:', user.email); handleEmailVerification(user) }) .catch(error => alert(error.message)) } const handleLogin = () => { const user = auth.currentUser; if (user) { user.reload().then(_ => { if (user.emailVerified) { auth .signInWithEmailAndPassword(email, password) .then(userCredentials => { const user = userCredentials.user; console.log('Logged in with:', user.email); }) .catch(error => alert(error.message)); } else { alert("email is not verified"); } }) } else { alert("User is null"); }
UI code:
<KeyboardAvoidingView style={styles.container} behavior="padding" > <View style={styles.inputContainer}> <View> <TextInput placeholder="GT Username" value={email} onChangeText={text => setEmail(text)} style={styles.input} /> </View> <TextInput placeholder="Password" value={password} onChangeText={text => setPassword(text)} style={styles.input} secureTextEntry /> </View> <View style={styles.buttonContainer}> <TouchableOpacity onPress={handleLogin} style={styles.button} > <Text style={styles.buttonText}>Login</Text> </TouchableOpacity> <TouchableOpacity onPress={handle#} style={[styles.button, styles.buttonOutline]} > <Text style={styles.buttonOutlineText}>Register</Text> </TouchableOpacity> <TouchableOpacity onPress={handleDeleteUser} style={[styles.button, styles.buttonOutline]} > <Text style={styles.buttonOutlineText}>Delete Account</Text> </TouchableOpacity> <TouchableOpacity onPress={()=>handleEmailVerification(auth.currentUser)} style={[styles.button, styles.buttonOutline]} > <Text style={styles.buttonOutlineText}>Resend Email Verification</Text> </TouchableOpacity> </View> </KeyboardAvoidingView>
firebase auth
import * as firebase from "firebase"; const auth = firebase.auth()
Very oddly, this code works for my personal gmail account, but no verification is ever sent to my school account, which ends with @gatech.edu
The text was updated successfully, but these errors were encountered:
No branches or pull requests
handler code:
UI code:
firebase auth
Very oddly, this code works for my personal gmail account, but no verification is ever sent to my school account, which ends with @gatech.edu
The text was updated successfully, but these errors were encountered: