diff --git a/frontend/i18n/locales/fr.json b/frontend/i18n/locales/fr.json index cd45bf8..1044ec1 100644 --- a/frontend/i18n/locales/fr.json +++ b/frontend/i18n/locales/fr.json @@ -237,6 +237,7 @@ "new": "Nouveau ticket", "created": "Ticket créé avec succès.", "deleted": "Ticket supprimé avec succès.", + "updated": "Ticket mis à jour avec succès.", "statusUpdated": "Statut du ticket mis à jour.", "type": { "bug": "Bug", @@ -290,6 +291,12 @@ "days": "Il y a {n}j" } }, + "profile": { + "title": "Mon profil", + "changeAvatar": "Changer l'avatar", + "removeAvatar": "Supprimer l'avatar", + "cropAvatar": "Recadrer l'avatar" + }, "bookstack": { "settings": { "title": "Configuration BookStack", diff --git a/frontend/middleware/auth.global.ts b/frontend/middleware/auth.global.ts index 69e8499..76af8ef 100644 --- a/frontend/middleware/auth.global.ts +++ b/frontend/middleware/auth.global.ts @@ -10,17 +10,16 @@ export default defineNuxtRouteMiddleware(async (to) => { return navigateTo('/login') } + const isClientOnly = auth.isAuthenticated + && auth.user?.roles?.includes('ROLE_CLIENT') + && !auth.user?.roles?.includes('ROLE_ADMIN') + if (isLogin && auth.isAuthenticated) { - const isClientOnly = auth.user?.roles?.includes('ROLE_CLIENT') && !auth.user?.roles?.includes('ROLE_ADMIN') return navigateTo(isClientOnly ? '/portal' : '/') } - // ROLE_CLIENT without ROLE_ADMIN: redirect to /portal, block internal pages - if (auth.isAuthenticated && auth.user?.roles?.includes('ROLE_CLIENT') && !auth.user?.roles?.includes('ROLE_ADMIN')) { - const isPortalRoute = to.path.startsWith('/portal') - const isLoginRoute = to.path === '/login' - if (!isPortalRoute && !isLoginRoute) { - return navigateTo('/portal') - } + const isProfileRoute = to.path === '/profile' + if (isClientOnly && !to.path.startsWith('/portal') && !isProfileRoute) { + return navigateTo('/portal') } }) diff --git a/frontend/pages/profile.vue b/frontend/pages/profile.vue new file mode 100644 index 0000000..625e5c5 --- /dev/null +++ b/frontend/pages/profile.vue @@ -0,0 +1,85 @@ + + +