Skip to content

Commit ba9a23c

Browse files
authored
Merge pull request #6012 from vuestorefront/#5565/empty-payload-clearCurrentUser
fix: #5565/empty payload clear current user
2 parents be94e29 + 111ae3d commit ba9a23c

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4545
- ESLint warnings caused by the double import - @lukaszjedrasik
4646
- Fix Order History Pagination - @AishwaryShrivastav / @lukaszjedrasik ([#4599](https://github.com/vuestorefront/vue-storefront/issues/4599))
4747
- Fix: Updating URL's params/query params with proper child SKU if options changes - @lukaszjedrasik ([#5981](https://github.com/vuestorefront/vue-storefront/issues/5981))
48+
- Fix: Passing `newToken: null` as a payload inside `clearCurrentUser` action - @lukaszjedrasik ([#5565](https://github.com/vuestorefront/vue-storefront/issues/5565))
4849

4950
### Changed / Improved
5051

core/modules/user/store/actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ const actions: ActionTree<UserState, RootState> = {
221221
}
222222
},
223223
clearCurrentUser ({ commit, dispatch }) {
224-
commit(types.USER_TOKEN_CHANGED, '')
224+
commit(types.USER_TOKEN_CHANGED, { newToken: null })
225225
commit(types.USER_GROUP_TOKEN_CHANGED, '')
226226
commit(types.USER_GROUP_CHANGED, null)
227227
commit(types.USER_INFO_LOADED, null)

core/modules/user/test/unit/store/actions.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ describe('User actions', () => {
396396

397397
(userActions as any).clearCurrentUser(contextMock)
398398

399-
expect(contextMock.commit).toHaveBeenNthCalledWith(1, types.USER_TOKEN_CHANGED, '')
399+
expect(contextMock.commit).toHaveBeenNthCalledWith(1, types.USER_TOKEN_CHANGED, { newToken: null })
400400
expect(contextMock.commit).toHaveBeenNthCalledWith(2, types.USER_GROUP_TOKEN_CHANGED, '')
401401
expect(contextMock.commit).toHaveBeenNthCalledWith(3, types.USER_GROUP_CHANGED, null)
402402
expect(contextMock.commit).toHaveBeenNthCalledWith(4, types.USER_INFO_LOADED, null)

0 commit comments

Comments
 (0)