Closed captainPrime closed 1 year ago
I didn't see the logic that remembers where the user was and redirects them back after login. Did I miss it? Also, I didnt see the logic that handles redirecting the user to the page they were if they happen to logout due to expired session and log back in. Depending on where they were, the request should also contain unsubmitted form data if they were on a page that has a form. So fir example they were creating a recipe, then they were primpted to log out and log in again, the request should remember both the route they were and the form payload so that the frontend can use the data to repopulate the form again so they dont have to start from scratch again.
https://stackoverflow.com/questions/53788975/vue-router-how-to-get-previous-page-url https://prismic.io/docs/vue-route-parameters
I was expecting a middleware or some implementation not tightly coupled to any component, to make it reuseable everywhere and just work automatically right out of the box.
Converted back to draft since it is still a WIP
I
I didn't see the logic that remembers where the user was and redirects them back after login. Did I miss it? Also, I didnt see the logic that handles redirecting the user to the page they were if they happen to logout due to expired session and log back in. Depending on where they were, the request should also contain unsubmitted form data if they were on a page that has a form. So fir example they were creating a recipe, then they were primpted to log out and log in again, the request should remember both the route they were and the form payload so that the frontend can use the data to repopulate the form again so they dont have to start from scratch again.
https://stackoverflow.com/questions/53788975/vue-router-how-to-get-previous-page-url https://prismic.io/docs/vue-route-parameters
I was expecting a middleware or some implementation not tightly coupled to any component, to make it reuseable everywhere and just work automatically right out of the box.
I refactored the approach to this feature... updated the auth middleware to handle saving the previous page and redirecting after login
Description
This pull request implements a feature that redirects the user back to the page they were on after they sign in. The feature uses Vue.js, Vuex, and vue-router to store the redirect path before the login action and then redirects the user to the stored path after successful login.
How Has This Been Tested?
I have tested this feature using the following steps:
npx nightwatch
.Checklist: