-
Notifications
You must be signed in to change notification settings - Fork 689
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
Firefox silent refresh changes main page URL #493
Comments
I have the same issue. I'm not sure if this is standard compliant behaviour or a firefox bug... Edit: here a simple javascript repro that demonstrates the problem |
This issue affects me as well. My workaround is to turn off
You can set This seems to solve the problem, but it's a workaround rather than a proper fix. As originally suggested by @jeroenheijmans in #408, I think that a proper solution would involve updating this:
such that we're also checking to ensure that there actually is a hash value before clearing it. Something like:
|
I confirmed this bug using my sample repo after disabling the very same I also confirmed that adding the extra check for I'll add a PR to update this. |
Firefox will show annoying behavior for setting location.hash to an empty string if it already is empty: it refreshes the page or scrolls to the top. The preventClearHashAfterLogin option is passed down to functions to prevent this behavior when it's not needed (e.g. during the results of a silent refresh). However, that option wasn't checked for in a consistent manner. This commit fixes that. Fixes manfredsteyer#493
I ran into an issue in Firefox where the silent refresh was triggering a location change which is causing an issue for us. This was brought up before in #408. The clearing of the hash in Firefox results in the '#' character being added to the URL. There is code to prevent clearing the hash if it is not an oidc flow by checking
preventClearHashAfterLogin
which appears to only be set when doing a silent refresh.angular-oauth2-oidc/projects/lib/src/oauth-service.ts
Line 1360 in 0274cf5
However, for oidc, the hash gets cleared in the processIdToken then() just a little bit below, and
preventClearHashAfterLogin
does not get checked.angular-oauth2-oidc/projects/lib/src/oauth-service.ts
Line 1386 in 0274cf5
It looks like the additional check should be added to that line so that silent refreshes don't affect the main document location/URL when using oidc.
I also noticed that the iframe url keeps the tokens in the URL hash. I don't know if that is the expected behavior. Either way, from the discussion in #408 (comment) it doesn't sound like the silent refresh should affect the main document's URL/location.
Thanks!
The text was updated successfully, but these errors were encountered: