Skip to content

Commit

Permalink
dont redirect to home when unauthenticated to submissions
Browse files Browse the repository at this point in the history
  • Loading branch information
devincowan committed Sep 20, 2024
1 parent 51d2d91 commit 2a3333c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/frontend/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ router.beforeEach((to, from, next) => {
const alertStore = useAlertStore()

if (!authStore.isLoggedIn && to.meta.requiresAuth) {
next('/')
// prevent redirect
next(from.path)
alertStore.displayAlert({
title: 'Not logged in',
text: `You must be logged in to access the ${to.name} page`,
Expand Down

0 comments on commit 2a3333c

Please sign in to comment.