| 12345678910111213141516171819202122 |
- import { currentProfile } from '../services'
-
-
- const checkLoginStatus = (destination, nextCb) => {
- console.warn('currentProfile logged in:', currentProfile.isLoggedIn())
- if (
- destination.meta.requiresCompleteProfile &&
- currentProfile.isLoggedIn() &&
- !currentProfile.isComplete()
- ) {
- nextCb('survey')
- } else if(
- destination.meta.requiresAuth &&
- !currentProfile.isLoggedIn()
- ) {
- nextCb('login')
- } else {
- nextCb()
- }
- }
-
- export { checkLoginStatus }
|