updating to use clerk auth with new routing to signin page by default
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
import { router } from 'expo-router'
|
||||
import React from 'react'
|
||||
import { StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native'
|
||||
import { useSession } from './ctx'
|
||||
|
||||
export default function LoginScreen() {
|
||||
const [username, setUsername] = React.useState('')
|
||||
const [password, setPassword] = React.useState('')
|
||||
const { login } = useSession()
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
@@ -30,22 +27,19 @@ export default function LoginScreen() {
|
||||
<TouchableOpacity
|
||||
style={styles.button}
|
||||
onPress={() => {
|
||||
login()
|
||||
if (localStorage.getItem('session') === 'success') {
|
||||
router.replace('/')
|
||||
}
|
||||
console.log('test')
|
||||
}}
|
||||
>
|
||||
<Text style={{ color: '#fff', fontWeight: 'bold' }}>Login</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity
|
||||
{/* <TouchableOpacity
|
||||
style={styles.signup}
|
||||
onPress={() => {
|
||||
router.navigate('/signup')
|
||||
}}
|
||||
>
|
||||
<Text style={{ color: '#fff' }}>Sign Up</Text>
|
||||
</TouchableOpacity>
|
||||
</TouchableOpacity> */}
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user