feat: registration with invite codes

This commit is contained in:
2026-08-31 21:35:37 +02:00
parent 68991a3722
commit 2c45478478
9 changed files with 645 additions and 11 deletions
+13
View File
@@ -28,12 +28,25 @@ const router = createRouter({
name: 'account',
component: () => import('../views/AccountView.vue'),
},
// Intentionally not linked from anywhere in the UI — reached only via an
// invite link (see router.beforeEach below) or by typing the URL directly.
{
path: '/register',
name: 'register',
component: () => import('../views/RegisterView.vue'),
},
],
})
router.beforeEach((to) => {
const authStore = useAuthStore()
// An invite link may point anywhere (e.g. the app root) so it still works
// if the recipient doesn't have the app installed/bookmarked at /register.
if (to.name !== 'register' && typeof to.query.invite === 'string' && to.query.invite) {
return { name: 'register', query: { invite: to.query.invite } }
}
if (to.meta.requiresAuth && !authStore.isAuthenticated) {
return { name: 'login', query: { redirect: to.fullPath } }
}