Skip to content

Commit

Permalink
#45 miss return to abort naviagation
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcellino-Palerme committed May 29, 2024
1 parent d86e3a1 commit 1813ad2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions middleware/checkLogin.global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
// This middleware verify if use logged

export default defineNuxtRouteMiddleware(async (to, from) => {

// when we open login page we do nothing
if (from.path == '/login'){
abortNavigation()
return abortNavigation();
}
if (to.path == '/login') {
return
Expand All @@ -17,7 +17,7 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
// get cookies
const token = useCookie("token",{sameSite:"strict"});
const team = useCookie("team",{sameSite:"strict"});

// if we have cookie, we check if we have the token
if (token.value && team.value){

Expand All @@ -28,7 +28,7 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
},
body: token.value.toString()
});

// user is log yet
if (data){
// Go to page ask
Expand Down

0 comments on commit 1813ad2

Please sign in to comment.