Fix redirect not working after login
Redirecting post-login for login-overlay.tsx
relies on the rd
query parameter to be set. This is correctly done when clicking
on a category card from the homepage (when unauthorized), but is
not done when accessing a different URL directly (such as /faq or
any documents), since the login form is displayed with the same
URL as the target destination.
This MR changes it so that if you are not logged in, direct resource
access (i.e. any page routed with UserRoute) will redirect to /login/
with the rd
parameter set, thereby correctly activating the
redirect post-login.
The MR also introduces a feature where if you refresh a login page after you logged in from another tab, you would be redirected properly to the target destination.