updating to use clerk auth with new routing to signin page by default

This commit is contained in:
Will Baumbach
2025-08-05 15:34:07 -05:00
parent 409f15f233
commit 10815a9a81
17 changed files with 1670 additions and 247 deletions

View File

@@ -0,0 +1,35 @@
import { useClerk } from '@clerk/clerk-expo'
import * as Linking from 'expo-linking'
import { StyleSheet, Text, TouchableOpacity } from 'react-native'
export const SignOutButton = () => {
// Use `useClerk()` to access the `signOut()` function
const { signOut } = useClerk()
const handleSignOut = async () => {
try {
await signOut()
// Redirect to your desired page
Linking.openURL(Linking.createURL('/'))
} catch (err) {
// See https://clerk.com/docs/custom-flows/error-handling
// for more info on error handling
console.error(JSON.stringify(err, null, 2))
}
}
return (
<TouchableOpacity onPress={handleSignOut} style={styles.button}>
<Text>Sign out</Text>
</TouchableOpacity>
)
}
const styles = StyleSheet.create({
button: {
width: '40%',
height: '5%',
backgroundColor: 'rgba(192, 196, 199, 1)',
borderRadius: 5,
alignItems: 'center',
justifyContent: 'center'
}
})