Skip to content

Commit

Permalink
FIxed: cleared userStore state on logout
Browse files Browse the repository at this point in the history
  • Loading branch information
k2maan committed Oct 12, 2023
1 parent f9310db commit ee97976
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
resetPermissions,
setPermissions
} from '@/authorization'
import { useAuthStore, translate } from '@hotwax/dxp-components'
import { translate, useAuthStore, useUserStore } from '@hotwax/dxp-components'
import { generateDeviceId, generateTopicName } from '@/utils/firebase'
import emitter from '@/event-bus'

Expand Down Expand Up @@ -143,6 +143,7 @@ const actions: ActionTree<UserState, RootState> = {
}

const authStore = useAuthStore()
const userStore = useUserStore()
// TODO add any other tasks if need
dispatch("product/clearProducts", null, { root: true })
dispatch('clearNotificationState')
Expand All @@ -153,6 +154,7 @@ const actions: ActionTree<UserState, RootState> = {

// reset plugin state on logout
authStore.$reset()
userStore.$reset()

// If we get any url in logout api resp then we will redirect the user to the url
if(redirectionUrl) {
Expand Down

0 comments on commit ee97976

Please sign in to comment.