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

fix(state_share): new method to include credentials for state sharing #500

Merged
merged 2 commits into from
Nov 18, 2023

Conversation

chrisj
Copy link
Contributor

@chrisj chrisj commented Nov 2, 2023

due to chrome introducing restrictions on setting protocols using the URL API

const x = new URL('http://google.com');
x.protocol = 'middleauth+https:';

The second line is silently rejected in chrome 118.

… due to chrome introducing restrictions on setting protocols using the URL API
@@ -73,8 +73,9 @@ export class StateShare extends RefCounted { // call it a widget? no because it
}, responseJson)
.then((res) => {
const stateUrl = new URL(res);
stateUrl.protocol = protocol; // copy protocol in case it contains authentication type
const link = `${window.location.origin}/#!${stateUrl}`;
const stateUrlWithoutProtocol = stateUrl.toString().split(stateUrl.protocol)[1];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split is kind of an odd way to handle this -- instead could just use substring(stateUrl.protocol.length)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, made this change

@jbms jbms merged commit ada384e into google:master Nov 18, 2023
16 of 20 checks passed
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