Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue in router.beforeEach() function. it show me the error that auth.loggedIn() is not declared. #3239

Closed
Abdurrahman-Alizada opened this issue Jun 18, 2020 · 1 comment

Comments

@Abdurrahman-Alizada
Copy link

Abdurrahman-Alizada commented Jun 18, 2020

This function is not working

router.beforeEach((to, from, next) => {

const requiresAuth = to.matched.some(x => x.meta.requiresAuth)
const currentUser = fb.auth().currentUser

if (requiresAuth && !currentUser) {
next('/')
} else if (requiresAuth && currentUser) {
next()
} else {
next()
}
})

while this is workable

router.beforeEach((to, from, next) => {

const requiresAuth = to.matched.some(x => x.meta.requiresAuth)
const currentUser = fb.auth().currentUser

if (requiresAuth && !currentUser) {
next('/')
} else if (requiresAuth && currentUser) {
next()
} else {
next()
}
})

@vue-bot
Copy link

vue-bot commented Jun 18, 2020

Hello, thank you for taking time filling this issue!

However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).

I hope to see your helper-created issue very soon!

@vue-bot vue-bot closed this as completed Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants