Skip to content

Commit

Permalink
Merge branch 'fix-login-redirect-by-param' into 'main'
Browse files Browse the repository at this point in the history
chore: fix login redirect by param

See merge request flattrack/flattrack!405
  • Loading branch information
BobyMCbobs committed Nov 1, 2024
2 parents 18daebd + 8054cc1 commit 81d81c7
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 81d81c7

Please sign in to comment.