-
Notifications
You must be signed in to change notification settings - Fork 284
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 a utility getAccessToken
to customerClient
#1607
Conversation
314781e
to
442c528
Compare
nonce: string; | ||
refresh_token: string; | ||
state: string; | ||
customerAccount: { |
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 only session key we are using now
'customer_access_token', | ||
'access_token', | ||
); | ||
expect(session.set).not.toHaveBeenNthCalledWith(1, 'customerAccount', { |
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.
Definitely simpler at least in the tests when it's all grouped together :)
session.unset('customer_access_token'); | ||
session.unset('state'); | ||
session.unset('nonce'); | ||
session.unset(CUSTOMER_ACCOUNT_SESSION_KEY); |
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.
This is better too, if we add other properties to the session, at least we won't accidentally forget to clear them.
Co-authored-by: Bret Little <[email protected]>
WHY are these changes introduced?
Add an
getAccessToken
to the customer client utility & restore the samecustomerAccessToken
session key as we have it now.The idea is that user will never need to care about token expiry or where to get the token when using customer utility
WHAT is this pull request doing?
getAccessToken
utilityHOW to test your changes?
Post-merge steps
Checklist