Skip to content

Commit

Permalink
chore: fix login redirect by param
Browse files Browse the repository at this point in the history
if the `redirect` param is set on the login page, navigate to the path specified
  • Loading branch information
BobyMCbobs committed Nov 1, 2024
1 parent 18daebd commit 8054cc1
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions web/src/router/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,24 @@ export default [
name: 'Login',
component: () => import('@/views/public/login.vue'),
beforeEnter: (to, from, next) => {
var instanceRegistered
var hasAuthToken
var validAuthToken
var nextRoute
let instanceRegistered
let hasAuthToken
let validAuthToken
let nextRoute

function handleRedirections () {
if (instanceRegistered && validAuthToken) {
if (
instanceRegistered &&
validAuthToken &&
to.query.redirect === null
) {
nextRoute = '/'
} else if (
instanceRegistered &&
validAuthToken &&
to.query.redirect !== null
) {
nextRoute = to.query.redirect
} else if (!instanceRegistered) {
nextRoute = '/setup'
} else if (!(hasAuthToken || validAuthToken)) {
Expand Down

0 comments on commit 8054cc1

Please sign in to comment.