misc: make sure redirection is not lost after outside navigation #1712
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes ISSUE-422
Context
If a user follows a link to Lago and is not redirected, they are asked to login.
Once logged in successfully, their reach their expected destination.
However, if a user logs in using a third party (like google SSO), this redirection logic breaks.
The reason is that during the thirdparty login process, they are redirected out the app and the "memory" of the destination page is lost.
Description
This PR addresses this situation and bring a fix using the browser's local storage.
When ever a user is
they now "register" their last visited page (or destination in the first case) into their local storage.
This data is not lost when they use a thirdparty login (unless they use private navigation probably)
--
This is the best approach I found regarding those criteria
It's not ideal, not the best, but probably the fastest approach regarding our current implemented logic.
I opened a ticket to refactor this approach, but mostly to change our route event and history system.