membermatters / MemberMatters

An open source membership, access and payments portal for makerspaces and community groups.
https://membermatters.org
MIT License
41 stars 23 forks source link

Login page doesn't redirect back to the page you were trying to get to if you were logged out #98

Closed jabelone closed 2 years ago

jabelone commented 3 years ago

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.

jabelone commented 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.

jabelone commented 2 years ago

Done!