mirror of
https://github.com/Paris-est-Ludique/ForceOrange.git
synced 2025-06-08 01:04:20 +02:00
13 lines
233 B
TypeScript
13 lines
233 B
TypeScript
export const useAuth = () => {
|
|
const user = useSupabaseUser()
|
|
const { auth } = useSupabaseClient()
|
|
|
|
auth.onAuthStateChange(async (event) => {
|
|
if (event === 'SIGNED_OUT')
|
|
navigateTo('/')
|
|
})
|
|
|
|
return {
|
|
user
|
|
}
|
|
} |