Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [vue-router] uncaught error during route navigation:
- Invalid object
- router.beforeEach((to, from, next) => {
- // Checking if user has verified the mobile number using firebase
- const currentUser = firebase.auth().currentUser
- // Checking if the requested path has meta requiresAuth
- var isUserLoggedIn = false
- const loginTokenExistsFlag = CookieManager.checkIfLoginTokenExists()
- if (loginTokenExistsFlag && currentUser) {
- isUserLoggedIn = true
- }
- var isUserActivated = false
- const profileDetails = CookieManager.getProfileDetails()
- if (profileDetails != null) {
- if (
- profileDetails.profile_user_description == null &&
- profileDetails.profile_name == null
- ) {
- isUserActivated = false
- }
- }
- if (isUserLoggedIn == false) {
- next('login')
- } else if (isUserLoggedIn == true && isUserActivated == false) {
- next('profile')
- } else {
- next()
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement