Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenID frontchannel redirect done twice #3342

Closed
3 of 6 tasks
CGNonofr opened this issue Nov 7, 2022 · 1 comment
Closed
3 of 6 tasks

OpenID frontchannel redirect done twice #3342

CGNonofr opened this issue Nov 7, 2022 · 1 comment
Assignees
Labels
bug Something is not working.

Comments

@CGNonofr
Copy link
Contributor

CGNonofr commented Nov 7, 2022

Preflight checklist

Describe the bug

In the logout page, the code is trying the change the url by using window.location.replace THEN window.location.href 250ms later.

The issue is when the url Hydra is redirecting to is a http 302 that redirects to another url, the window.location.href call makes the browser come back once again to the original redirect url, making the call 2 times (when the loading takes more than 250ms).

Reproducing the bug

Reproducing with hydra needs a lot of configuration, but I can demonstrate the bug in the code snippet:

	function redirect() {
		window.location.replace(redir);
		// In case replace failed try href
		setTimeout(function () {
			window.location.href = redir;
		}, 250); // Show message after http-equiv="refresh"
	}
  • Go to any site
  • Clear the browser network console
  • Go to the javascript console and execute:
const redir = 'https://tinyurl.com/codingame-test-redirect';

window.location.replace(redir);
	
setTimeout(function () {
    window.location.href = redir;
}, 10);
  • Go back to the network console, you'll notice the call to https://tinyurl.com/codingame-test-redirect has been done twice, will the first one has been cancelled

Relevant log output

No response

Relevant configuration

No response

Version

2.0.1

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Kubernetes with Helm

Additional Context

This behavior can be observed at least with latest Chrome and latest Firefox

@CGNonofr CGNonofr added the bug Something is not working. label Nov 7, 2022
@aeneasr
Copy link
Member

aeneasr commented Nov 16, 2022

Thank you, we aknowledge this problem. Any PRs with fixes are welcomed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

2 participants