astarte-platform / astarte-dashboard

Astarte dashboard
http://astarte-platform.org
Apache License 2.0
17 stars 16 forks source link

Cannot go back through browser's history after authenticating on the Dashboard #385

Closed davidebriani closed 8 months ago

davidebriani commented 1 year ago

To authenticate a session on the Dashboard, the user is sent to a specific URL path /auth that handles auth verification before redirecting the user either to Login, if the session's token is invalid, or to authenticated pages.

However, attempting to go back through browser's history will lead the user to the /auth URL that immediately redirects to a new location; trying to go back again leads once more to the /auth URL. Such a loop effectively prevents the user to go back to URL that were visited before authenticating with the Dashboard.

davidebriani commented 1 year ago

A solution to the issue could be to have the /auth page redirect the user by replacing the current browser's location, so that the /auth URL does not appear within the browser's history after the auth validation.