Closed jabelone closed 2 years ago
Half of this has been implemented now in fcdf7c011b41256daf29d07ae35662cb6b313b09 (pending merge in #158). There is now a nextUrl
parameter that the route guard and login page check for. If present, the user will be redirected there after a successful login.
The only thing left is to now update the 401 handler to include the URL of the current page in the new nextUrl
parameter when it redirects the user to the login page for re-authentication.
Done!
When a logged out user tries to hit a page directly and it requires them to be logged in, they are redirected to the login page. They can then login, but after doing so, they're taken to the dashboard. Instead, the login form should capture the page they came from and redirect them back to that after logging in.