mirror of
https://github.com/Paris-est-Ludique/ForceOrange.git
synced 2025-06-08 01:04:20 +02:00
🐛 fixing routing after reset password success
This commit is contained in:
parent
8f21d3d615
commit
9a12d6b6fa
@ -6,7 +6,7 @@ defineOptions({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const { user, displayName, waitingMailValidation, loading } = storeToRefs(useProfile())
|
const { user, displayName, waitingMailValidation, loading } = storeToRefs(useMember())
|
||||||
const { auth } = useSupabaseClient<Database>()
|
const { auth } = useSupabaseClient<Database>()
|
||||||
const { showErrorPage } = useErrorSystem()
|
const { showErrorPage } = useErrorSystem()
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ const signOut = async () => {
|
|||||||
const { error } = await auth.signOut()
|
const { error } = await auth.signOut()
|
||||||
|
|
||||||
showErrorPage(error)
|
showErrorPage(error)
|
||||||
router.push('/')
|
router.push('/signin')
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
export default defineNuxtRouteMiddleware((to, _from) => {
|
export default defineNuxtRouteMiddleware((to, _from) => {
|
||||||
const { roles } = storeToRefs(useProfile())
|
const { roles } = storeToRefs(useMember())
|
||||||
|
|
||||||
if (!roles.value.incllude('admin')) {
|
if (!roles.value.include('admin')) {
|
||||||
return navigateTo('/')
|
return navigateTo('/')
|
||||||
}
|
}
|
||||||
})
|
})
|
@ -8,6 +8,6 @@ const router = useRouter()
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<UCard class="container mx-auto max-w-screen-md">
|
<UCard class="container mx-auto max-w-screen-md">
|
||||||
<PasswordUpdateForm @success="() => router.to('/signin')" />
|
<PasswordUpdateForm @success="() => router.push('/')" />
|
||||||
</UCard>
|
</UCard>
|
||||||
</template>
|
</template>
|
@ -5,7 +5,7 @@ definePageMeta({
|
|||||||
name: 'Profile',
|
name: 'Profile',
|
||||||
})
|
})
|
||||||
|
|
||||||
const { displayName, profile } = storeToRefs(useProfile())
|
const { displayName, profile } = storeToRefs(useMember())
|
||||||
|
|
||||||
const isPasswordModalOpen = ref(false)
|
const isPasswordModalOpen = ref(false)
|
||||||
const isEmailModalOpen = ref(false)
|
const isEmailModalOpen = ref(false)
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
// },
|
// },
|
||||||
// }
|
// }
|
||||||
|
|
||||||
export const useProfile = defineStore('profile', () => {
|
export const useMember = defineStore('member', () => {
|
||||||
const user = useSupabaseUser()
|
const user = useSupabaseUser()
|
||||||
const client = useSupabaseClient()
|
const client = useSupabaseClient()
|
||||||
const { showErrorPage } = useErrorSystem()
|
const { showErrorPage } = useErrorSystem()
|
||||||
@ -85,5 +85,5 @@ export const useProfile = defineStore('profile', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (import.meta.hot) {
|
if (import.meta.hot) {
|
||||||
import.meta.hot.accept(acceptHMRUpdate(useProfile, import.meta.hot))
|
import.meta.hot.accept(acceptHMRUpdate(useMember, import.meta.hot))
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user