Files
AppDev/FastNotes/components/social-auth-buttons/sign-out-button.tsx
2026-03-04 02:15:53 +01:00

20 lines
456 B
TypeScript

import { supabase } from '@/libs/supabase'
import { router } from 'expo-router'
import React from 'react'
import { Button } from 'react-native'
async function onSignOutButtonPress() {
const { error } = await supabase.auth.signOut()
if (error) {
console.error('Error signing out:', error)
return
}
router.replace('/login')
}
export default function SignOutButton() {
return <Button title="Sign out" onPress={onSignOutButtonPress} />
}