mirror of
https://github.com/Paris-est-Ludique/ForceOrange.git
synced 2025-09-12 06:50:10 +02:00
✨ Complete all user management with forms and DB
This commit is contained in:
committed by
ChatonDeAru (Romain)
parent
37b2238b84
commit
5fa1f24caf
13
modules/app/composables/auth.ts
Normal file
13
modules/app/composables/auth.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export const useAuth = () => {
|
||||
const user = useSupabaseUser()
|
||||
const { auth } = useSupabaseClient()
|
||||
|
||||
auth.onAuthStateChange(async (event) => {
|
||||
if (event === 'SIGNED_OUT')
|
||||
navigateTo('/')
|
||||
})
|
||||
|
||||
return {
|
||||
user
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user