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

Update SLAS helper to require channel_id #165

Merged
merged 5 commits into from
Jul 16, 2024
Merged

Conversation

joeluong-sfcc
Copy link
Contributor

Starting 7/31/2024, SLAS will start requiring the channel_id as a required argument when retrieving an access token with grant_type: 'client_credentials for security purposes. This PR updates the loginGuestUserPrivate SLAS helper function to require channel_id.

@joeluong-sfcc joeluong-sfcc requested a review from a team as a code owner July 15, 2024 14:24
@joeluong-sfcc joeluong-sfcc changed the title update SLAS helper to require channel_id Update SLAS helper to require channel_id Jul 15, 2024
@joeluong-sfcc joeluong-sfcc mentioned this pull request Jul 16, 2024
Copy link
Contributor

@adamraya adamraya left a comment

Choose a reason for hiding this comment

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

Not related to this change but I see the loginGuestUserPrivate is async, yet I don't see any await statement inside the function.

Are we missing an await statement here?

return slasClient.getAccessToken(options);

return await slasClient.getAccessToken(options);

@joeluong-sfcc
Copy link
Contributor Author

joeluong-sfcc commented Jul 16, 2024

Not related to this change but I see the loginGuestUserPrivate is async, yet I don't see any await statement inside the function.

Are we missing an await statement here?

return slasClient.getAccessToken(options);

return await slasClient.getAccessToken(options);

@adamraya Someone can correct my javascript knowledge if its incorrect, but I believe that marking a function with async means that return value is automatically a promise, so although we don't use await statements, we return a Promise<TokenResponse>

@joeluong-sfcc joeluong-sfcc merged commit 1e893c7 into main Jul 16, 2024
8 checks passed
@joeluong-sfcc joeluong-sfcc deleted the ju/require-client-id branch July 16, 2024 19:13
@adamraya
Copy link
Contributor

Someone can correct my javascript knowledge if its incorrect, but I believe that marking a function with async means that return value is automatically a promise, so although we don't use await statements, we return a Promise<TokenResponse>

Yes you're right, the function marked with async automatically returns a promise. It will not wait for getAccessToken to resolve before returning, but I guess subsequent operations are handled in getAccessToken.

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.

3 participants