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,
|
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 = (
|
||||||
|
@ -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}>
|
||||||
|
Loading…
Reference in New Issue
Block a user