Skip to content

Conversation

@tuomassalo
Copy link
Contributor

This changes a location.assign(...) to a history.replaceState(...) in order to avoid an unnecessary (?) full page reload, in case we just want to remove the hash part, eg. #access_token=....

This fixes a problem we ran into: Safari (macOS) would sometimes execute location.assign() before the asynchronous code that actually saves the access token to storage would finish.

Yes, sometimes. It seems to be a timing issue that happens when the actual page loads slowly.

This Works For Me™, and I apologize for not having time to build a test case. Also, my knowledge of all this stuff is quite limited, so I'm not claiming this PR to be a trouble-free. I'm PR'ing FYI anyway.

@MrSwitch
Copy link
Owner

MrSwitch commented Apr 12, 2017

Is this just in the page auth flow? Do you know if the storage is also flakey with the window.close() being called on popup auth flow?

Could you remove the changes to dist/? Thanks

@tuomassalo
Copy link
Contributor Author

I encountered this error within page auth flow. I haven't investigated popup auth flow.

Closing this in favor of #490.

@tuomassalo tuomassalo closed this Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants