working, needs testing on physical device
This commit is contained in:
parent
6b8737e182
commit
3b1abc9ae8
@ -30,19 +30,22 @@ export const confirmCode = async (
|
||||
}
|
||||
};
|
||||
|
||||
export const createOrSignInUser = (
|
||||
export const createOrSignInUser = async (
|
||||
email: string,
|
||||
password: string,
|
||||
isSignUp: boolean,
|
||||
) => {
|
||||
console.log("isSignUp", isSignUp);
|
||||
try {
|
||||
if (isSignUp) {
|
||||
auth().createUserWithEmailAndPassword(email, password);
|
||||
await auth().createUserWithEmailAndPassword(email, password);
|
||||
} else {
|
||||
auth().signInWithEmailAndPassword(email, password);
|
||||
await auth().signInWithEmailAndPassword(email, password);
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
// TODO: #107 -- Correct error handling
|
||||
Alert.alert(err.message)
|
||||
}
|
||||
} catch (err) {}
|
||||
};
|
||||
|
||||
export const onAuthStateChanged = (
|
||||
|
@ -7,7 +7,6 @@ import { useAuth } from "../context";
|
||||
// Sign out button only functional when NOT using dev env
|
||||
export default function ProfileScreen() {
|
||||
const { user } = useAuth();
|
||||
console.log(user);
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
|
Loading…
Reference in New Issue
Block a user