This commit is contained in:
2026-08-30 16:08:57 +02:00
parent f2197a6b28
commit 78cb70d8e8
28 changed files with 740 additions and 42 deletions
+10 -1
View File
@@ -41,6 +41,12 @@ const router = createRouter({
path: '/',
component: AppLayout,
children: [
{
path: ':serverId([0-9a-fA-F-]{36})',
name: 'server-invite',
component: () => import('@/pages/server/invite.vue'),
props: true,
},
{
path: '',
name: 'home',
@@ -101,7 +107,10 @@ router.beforeEach(async (to) => {
if (authRequired && !authStore.isAuthenticated) {
// Non connecté -> Login
return '/auth/login'
if (to.name === 'server-invite') {
return {name: 'join', query: {serverId: String(to.params.serverId)}}
}
return {name: 'login', query: {redirect: to.fullPath}}
} else if (to.name === 'login' && authStore.isAuthenticated) {
// Déjà connecté -> Accueil
return '/'