Fix double login in specific cases #4568
Merged
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.
Double login could occur if LoginView would start the normal login process and then the URL would change (e.g. when native part would change trigger login with specific account). In this case a second LoginView would be constructed and would start the login on its own. Normally this shouldn't happen but for LoginView we specifically opted into not caching it to not accidentally hold to credentials any longer than necessary.
To prevent this issue we should not create LoginView manually but let mithril do it. This is a bit tricky as LoginView needs some info passed into it. We ended up rewriting LoginView as a proper component and creating a new RouteResolver implementation that can work with this type of views.
fix #4554
fix #4570
also see the same branch for admin client