-
Notifications
You must be signed in to change notification settings - Fork 291
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
Enhancement/9621 update siwg client id url #9689
base: develop
Are you sure you want to change the base?
Conversation
Build files for d124ff9 are ready:
|
Size Change: +152 B (+0.01%) Total Size: 1.88 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jimmymadon – this looks great overall, just a few comments and one change that just came in that makes more sense to do here than separately.
const query = { | ||
appname: siteName, | ||
sitename: siteName, | ||
siteurl: homeURL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the change here, but we need to pass the origin here instead. Essentially:
siteurl: homeURL, | |
siteorigin: new URL( homeURL ).origin, |
* Gets a URL to fetch the client ID. | ||
* | ||
* @since n.e.x.t | ||
* | ||
* @param {Object} state Data store's state. | ||
* @return {(string|undefined)} The URL to the clientID, or `undefined` if not loaded. | ||
*/ | ||
getClientIDURL: createRegistrySelector( ( select ) => () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a bad idea to give this a dedicated selector but we generally name these using a getService*URL
to indicate the URL is based on the serviceURL. Maybe getServiceClientIDProvisioningURL
while a bit long would be much more clear :) WDYT?
*/ | ||
getClientIDURL: createRegistrySelector( ( select ) => () => { | ||
const siteName = select( CORE_SITE ).getSiteName(); | ||
const homeURL = untrailingslashit( select( CORE_SITE ).getHomeURL() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trailing slash is irrelevant now given we only need the origin
which wouldn't include any part of the path.
@@ -86,6 +86,11 @@ it( 'ensures all serviceURLs are properly constructed', () => { | |||
'https://search.google.com/search-console/foo-path', | |||
'https://search.google.com/search-console/foo-path?bar=baz', | |||
], | |||
'modules/sign-in-with-google': [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Summary
Addresses issue:
Relevant technical choices
PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist