DEV Community

Discussion on: Building User Accounts with Nuxt, Vuex, and Firebase

Collapse
 
seriouslee13 profile image
SeriousLee13

Cool article, but how do you prevent users from accessing pages that require authentication, as middleware runs only on server side on initial page load?

Collapse
 
drewclem profile image
Drew Clements

Great question! Perhaps I should update this article to include that.

In the meantime, you can check out this repo that does just that.
github.com/drewclem/Colt

Here is where middleware is set up
github.com/drewclem/Colt/blob/mast...
And here is how you would lock a page behind the authentication (see line 43)
github.com/drewclem/Colt/blob/mast...