Skip to content

Commit

Permalink
#2490 - do not redirect to if that route does not require auth
Browse files Browse the repository at this point in the history
  • Loading branch information
rmmayo committed Jun 12, 2024
1 parent 2602d0d commit 2fa0846
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dashboard-prime/src/interceptors/UseErrorHandling.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from 'axios';
import { useRouter } from 'vue-router'
import { useRoute, useRouter } from 'vue-router'
import { useAuthState } from '@/stores/UseAuthState.js'
import { useAppConfig } from '@/common-components/stores/UseAppConfig.js'
import { userErrorState } from '@/stores/UserErrorState.js'
Expand All @@ -8,6 +8,7 @@ import { useLog } from '@/components/utils/misc/useLog.js'

export const useErrorHandling = () => {

const route = useRoute()
const router = useRouter()
const authState = useAuthState()
const appConfig = useAppConfig()
Expand Down Expand Up @@ -53,7 +54,7 @@ export const useErrorHandling = () => {
const path = window.location.pathname;
if (errorCode === 401) {
authState.clearAuthData()
if (path !== '/skills-login') {
if (path !== '/skills-login' && route.meta.requiresAuth) {
let loginRoute = path !== '/' ? { name: 'Login', query: { redirect: path } } : { name: 'Login' };
if (appConfig.isPkiAuthenticated) {
loginRoute = path !== '/' ? { name: 'LandingPage', query: { redirect: path } } : { name: 'LandingPage' };
Expand Down

0 comments on commit 2fa0846

Please sign in to comment.