-
Notifications
You must be signed in to change notification settings - Fork 683
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
[PWA-147] Sign Out should revoke customer token using graphql mutation #2012
Conversation
- Add test to cover new functionality
|
// Sign the user out in local storage and Redux. | ||
export const signOut = ({ history, revokeToken }) => async dispatch => { | ||
// Send mutation to revoke token. | ||
await revokeToken(); |
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.
Technically this will return an error if called without a bearer token. Do we care? Probably not, but I would possibly catch and do something with the error just incase.
{
"errors": [
{
"message": "The current customer isn't authorized.",
"category": "graphql-authorization",
"locations": [
{
"line": 2,
"column": 5
}
],
"path": [
"revokeCustomerToken"
]
}
],
"data": {
"revokeCustomerToken": null
}
}
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.
Fixed in 1f680c4
- Move refresh effect to signOut callback
Description
App should revoke Customer token on sign out using GraphQL mutation.
Related Issue
Acceptance
Verification Stakeholders
Specification
Verification Steps
getCustomer
query in a GraphQL client, being sure to appendAuthorization: Bearer <token>
header to requestgetCustomer
query again. You should now getThe current customer isn't authorized.
Screenshots / Screen Captures (if appropriate)
Checklist