From 11905af69b75d0cbfa0fb22c2b9d71601355b711 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sun, 21 Aug 2022 12:30:19 +0530 Subject: [PATCH] refactor(gui-v2): corrections Signed-off-by: Pranav C --- packages/nc-gui-v2/middleware/auth.global.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui-v2/middleware/auth.global.ts b/packages/nc-gui-v2/middleware/auth.global.ts index 785791011c..30d1b805f8 100644 --- a/packages/nc-gui-v2/middleware/auth.global.ts +++ b/packages/nc-gui-v2/middleware/auth.global.ts @@ -33,9 +33,11 @@ export default defineNuxtRouteMiddleware((to, from) => { /** if auth is required or unspecified (same as required) and user is not signed in, redirect to signin page */ if ((to.meta.requiresAuth || typeof to.meta.requiresAuth === 'undefined') && !state.signedIn.value) { - if (state.appInfo?.value?.firstUser) { + /** If this is the first usern navigate to signup page directly */ + if (state.appInfo.value.firstUser) { return navigateTo('/signup') } + return navigateTo('/signin') } else if (to.meta.requiresAuth === false && state.signedIn.value) { /**