Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
| Numéro du ticket | Titre du ticket | |------------------|-----------------| | | | ## Description de la PR ## Modification du .env ## Check list - [ ] Pas de régression - [ ] TU/TI/TF rédigée - [ ] TU/TI/TF OK - [ ] CHANGELOG modifié Reviewed-on: #9 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
13 lines
272 B
TypeScript
13 lines
272 B
TypeScript
export default defineNuxtRouteMiddleware(async () => {
|
|
const auth = useAuthStore()
|
|
|
|
if (!auth.checked) {
|
|
await auth.ensureSession()
|
|
}
|
|
|
|
const isSuperAdmin = auth.user?.roles?.includes('ROLE_SUPER_ADMIN')
|
|
if (!isSuperAdmin) {
|
|
return navigateTo('/')
|
|
}
|
|
})
|