Browse Source

fix: set redirect info to local storage

pull/9294/head
Pranav C 3 months ago
parent
commit
33cc226e81
  1. 1
      packages/nc-gui/middleware/02.auth.global.ts

1
packages/nc-gui/middleware/02.auth.global.ts

@ -80,6 +80,7 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
/** if user is still not signed in, redirect to signin page */ /** if user is still not signed in, redirect to signin page */
if (!state.signedIn.value) { if (!state.signedIn.value) {
localStorage.setItem('continueAfterSignIn', to.fullPath)
return navigateTo({ return navigateTo({
path: '/signin', path: '/signin',
query: to.fullPath !== '/' && to.fullPath.match(/^\/(?!\?)/) ? { continueAfterSignIn: to.fullPath } : {}, query: to.fullPath !== '/' && to.fullPath.match(/^\/(?!\?)/) ? { continueAfterSignIn: to.fullPath } : {},

Loading…
Cancel
Save