[Vuejs]-User authentication with Vue.js 2 and Express.js with Passport

0👍

I am currently looking into this myself, and having worked with vue-router a little bit I think that router.beforeEach might do the trick: https://router.vuejs.org/en/advanced/navigation-guards.html

The way I see it is that a promise inside beforeEach route guard would be calling the backend api route and in case of success would be resolved and navigation to our route can continue, in case it’s rejected – user’s redirected to login route.

Will respond later once I’ve looked into this propertly myself as I’m still learning. Let me know if you have learnt anything about it since you’ve created this question.

Leave a comment