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,
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) {}
} catch (err) {
console.log(err)
// TODO: #107 -- Correct error handling
Alert.alert(err.message)
}
};
export const onAuthStateChanged = (