Closed jordan-rash closed 8 months ago
So, i realized that we shouldn't need to check localstorage at all....auth0 drops all its persistance, so we should just check isAuthenticated
.....
So, i realized that we shouldn't need to check localstorage at all....auth0 drops all its persistance, so we should just check
isAuthenticated
.....
We know we need those 3 items for our app to work. If using whatever auth0 stores in local storage and subsequently checks is sufficient then so be it. Checking local storage ourselves is less magical, and it isn't much overhead. We need a route guard to prevent authenticated users from visiting the login page.
We need a route guard to prevent authenticated users from visiting the login page
this makes sense and i think this is where we check localstorage (which i think is what you said, but I just wanted to make sure we are on the same page)
@jordan-rash would this be a good place to check for the presence of an existing user in local storage?
A guard installed via the router to prevent users from reaching this login page completely and get redirected to the library would be nice. Something like
beforeEnter: [unauthorized]
could be added to the routes we need to ensure a user has been bound.router/router.js:
router/guards/unauthorized.js: