-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add support for SLAS DNT (do not track) parameter #167
Conversation
@@ -47,6 +47,7 @@ const parameters = { | |||
refreshToken: 'refresh_token', | |||
usid: 'usid', | |||
hint: 'hint', | |||
dnt: 'true', |
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.
well, the API spec says this parameter is string
.. which is kinda weird to me, shouldn't it be a boolean
? I'm gonna ask
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.
Agreed that it is a bit weird, but if it changes in the RAML spec from type string to type boolean it'll be a breaking change :(
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.
Good call. I'm going to make the SLAS helpers to accepts booleans and do a .toString()
to convert it before calling the API client.
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.
Can you update the CHANGELOG? otherwise LGTM
@@ -166,6 +166,7 @@ export async function authorize( | |||
* @param credentials.clientSecret - secret associated with client ID | |||
* @param parameters - parameters to pass in the API calls. | |||
* @param parameters.usid? - Unique Shopper Identifier to enable personalization. | |||
* @param parameters.dnt? - Optional parameter to enable Do Not Track (DNT) for the user. |
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.
Since it is boolean, does it make sense to set default value instead of making the parameter optional?dnt=true
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 default is controlled at the API level, if this parameter is not present, SLAS default to dnt=false
.
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.
One thing we should be weary of is if this dnt
field will be subject to change in the future. If it gets updated to accept other string values besides 'true'
and 'false'
this implementation will break
If we expect this to be updated in the future we should probably revert to the previous implementation. Given the nature of the field I can't imagine any other options, but better to be safe than sorry, let's check with the SLAS team first if we want to use this approach
This PR adds a new optional parameter
dnt
to SLAS helpers:loginGuestUserPrivate
,loginGuestUser
andloginRegisteredUserB2C