Issue in log in redirect when query param in URL

Hey all there’s a bug with redirection on Log in action. If there’s a query param in the current URL, the code is added like this id=1?code=
Which does not render the log in state

I would also when I fix it in the URL, the current user is detected. However, when making a request with user rights normal user, it asks me to log in again.