Add Sign in with Apple sorta

This commit is contained in:
2025-03-05 12:58:41 -06:00
parent c62926b8f2
commit 708c0553f5
4 changed files with 29 additions and 37 deletions

View File

@@ -22,7 +22,7 @@ const LoginPage = () => {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [loading, setLoading] = useState(false);
// Set up auto-refreshing for web
useEffect(() => {
if (Platform.OS === 'web') {
@@ -32,7 +32,7 @@ const LoginPage = () => {
};
}
}, []);
const signInWithEmail = async () => {
setLoading(true);
const { error } = await supabase.auth.signInWithPassword({
@@ -42,7 +42,7 @@ const LoginPage = () => {
if (error) Alert.alert(error.message);
setLoading(false);
};
const signUpWithEmail = async () => {
setLoading(true);
const {
@@ -56,7 +56,7 @@ const LoginPage = () => {
else if (!session) Alert.alert('Please check your inbox for email verification!');
setLoading(false);
};
return (
<ThemedView style={styles.container}>
<ThemedView style={styles.titleContainer}>
@@ -65,7 +65,7 @@ const LoginPage = () => {
Tech Tracker
</ThemedText>
</ThemedView>
<ThemedView style={[styles.verticallySpaced]}>
<ThemedTextInput
fontSize={24}
@@ -74,7 +74,7 @@ const LoginPage = () => {
placeholder='email@address.com'
/>
</ThemedView>
<ThemedView style={styles.verticallySpaced}>
<ThemedTextInput
fontSize={24}
@@ -84,7 +84,7 @@ const LoginPage = () => {
placeholder='Password'
/>
</ThemedView>
<ThemedView style={[styles.verticallySpaced, styles.mt20]}>
<ThemedTextButton
text='Sign in'
@@ -93,7 +93,7 @@ const LoginPage = () => {
fontSize={24}
/>
</ThemedView>
<ThemedView style={styles.verticallySpaced}>
<ThemedTextButton
text='Sign up'
@@ -102,10 +102,10 @@ const LoginPage = () => {
fontSize={24}
/>
</ThemedView>
{/* Apple Sign In - Only shows on iOS */}
<ThemedView style={[styles.verticallySpaced, styles.mt20]}>
<AppleSignIn
<AppleSignIn
onSignInStart={() => setLoading(true)}
onSignInComplete={() => setLoading(false)}
onSignInError={() => setLoading(false)}