Permalink
Browse files

fix(middleware): redirects

  • Loading branch information...
pi0 committed Nov 12, 2017
1 parent 7b0f14c commit 77bd1e434a33eaa58f0e7e2fb53ecc1734caec59
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/templates/auth.middleware.js
@@ -3,13 +3,13 @@ import middleware from './middleware'
middleware.auth = function authMiddleware ({ store, redirect }) {
// If user not logged in, redirect to /login
if (!store.getters['auth/loggedIn']) {
return redirect('<%= options.redirect.loggedIn %>')
return redirect('<%= options.redirect.notLoggedIn %>')
}
}
middleware['no-auth'] = function noAuthMiddleware ({ store, redirect }) {
// If user is already logged in, redirect to /
if (store.getters['auth/loggedIn']) {
return redirect('<%= options.redirect.notLoggedIn %>')
return redirect('<%= options.redirect.loggedIn %>')
}
}

0 comments on commit 77bd1e4

Please sign in to comment.