Closed joeluong-sfcc closed 3 months ago
Not related to this change but I see the
loginGuestUserPrivate
is async, yet I don't see anyawait
statement inside the function.Are we missing an
await
statement here?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>
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 aPromise<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.
Starting 7/31/2024, SLAS will start requiring the
channel_id
as a required argument when retrieving an access token withgrant_type: 'client_credentials
for security purposes. This PR updates theloginGuestUserPrivate
SLAS helper function to requirechannel_id
.