working, needs testing on physical device

This commit is contained in:
Loewy 2024-02-08 13:02:18 -08:00
parent 6b8737e182
commit 3b1abc9ae8
2 changed files with 8 additions and 6 deletions

View File

@ -30,19 +30,22 @@ export const confirmCode = async (
} }
}; };
export const createOrSignInUser = ( export const createOrSignInUser = async (
email: string, email: string,
password: string, password: string,
isSignUp: boolean, isSignUp: boolean,
) => { ) => {
console.log("isSignUp", isSignUp);
try { try {
if (isSignUp) { if (isSignUp) {
auth().createUserWithEmailAndPassword(email, password); await auth().createUserWithEmailAndPassword(email, password);
} else { } else {
auth().signInWithEmailAndPassword(email, password); await auth().signInWithEmailAndPassword(email, password);
} }
} catch (err) {} } catch (err) {
console.log(err)
// TODO: #107 -- Correct error handling
Alert.alert(err.message)
}
}; };
export const onAuthStateChanged = ( export const onAuthStateChanged = (

View File

@ -7,7 +7,6 @@ import { useAuth } from "../context";
// Sign out button only functional when NOT using dev env // Sign out button only functional when NOT using dev env
export default function ProfileScreen() { export default function ProfileScreen() {
const { user } = useAuth(); const { user } = useAuth();
console.log(user);
return ( return (
<View style={styles.container}> <View style={styles.container}>