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

Protected content appears before role validation is complete #8

Open
sbay opened this issue Feb 4, 2019 · 2 comments
Open

Protected content appears before role validation is complete #8

sbay opened this issue Feb 4, 2019 · 2 comments

Comments

@sbay
Copy link

sbay commented Feb 4, 2019

vue & vue-router-permissions version

Vue -- 2.5.21
Vue Router -- 3.0.2

Reproduction Link

Out of the box

Steps to reproduce

Setup access per documentation. Notice how when you have a protected route, it will flash before redirecting when access is not allowed.

What is Expected?

Protected content will not be shown during access validation. Should most likely tie into VueRouter's navigation guards logic (ie beforeEach) to bring validation higher up the chain.

What is actually happening?

Protected content is appearing on screen before access validation is performed and executed.

@anthonygore
Copy link
Owner

Thanks for reporting, I'll look into it

@anthonygore
Copy link
Owner

Do you have a reproduction link? The thing is, this runs synchronously and is triggered by the Vue Router beforeEach hook, which, by definition, will run before the route is accessed. I think we have to rule out the possibility of there being a different error in your scenario.

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