Skip to content

Commit

Permalink
fix login authenticated redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
modulsx committed Apr 3, 2021
1 parent 28b267a commit cde6780
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/middlewares/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ const isAuthenticated = async (ctx, next) => {
if(ctx.url !== "/login" && !ctx.session.isAuthenticated){
return ctx.redirect('/login')
}
else if(ctx.url === "/login" && ctx.session.isAuthenticated){
return ctx.redirect('/apps')
}
await next()
}

Expand Down

0 comments on commit cde6780

Please sign in to comment.