mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #914 from gradido/fix-double-redirect-after-logout
fix: Double Redirect After Logout with Expired JWT
This commit is contained in:
commit
b5dc6742e3
@ -32,6 +32,9 @@ describe('DashboardLayoutGdd', () => {
|
||||
},
|
||||
$router: {
|
||||
push: routerPushMock,
|
||||
currentRoute: {
|
||||
path: '/overview',
|
||||
},
|
||||
},
|
||||
$toasted: {
|
||||
error: toasterMock,
|
||||
@ -143,21 +146,23 @@ describe('DashboardLayoutGdd', () => {
|
||||
it('redirects to login page', () => {
|
||||
expect(routerPushMock).toBeCalledWith('/login')
|
||||
})
|
||||
})
|
||||
|
||||
describe('logout fails', () => {
|
||||
beforeEach(() => {
|
||||
apolloMock.mockRejectedValue({
|
||||
message: 'error',
|
||||
})
|
||||
describe('logout fails', () => {
|
||||
beforeEach(async () => {
|
||||
apolloMock.mockRejectedValue({
|
||||
message: 'error',
|
||||
})
|
||||
await wrapper.findComponent({ name: 'sidebar' }).vm.$emit('logout')
|
||||
await flushPromises()
|
||||
})
|
||||
|
||||
it('dispatches logout to store', () => {
|
||||
expect(storeDispatchMock).toBeCalledWith('logout')
|
||||
})
|
||||
it('dispatches logout to store', () => {
|
||||
expect(storeDispatchMock).toBeCalledWith('logout')
|
||||
})
|
||||
|
||||
it('redirects to login page', () => {
|
||||
expect(routerPushMock).toBeCalledWith('/login')
|
||||
})
|
||||
it('redirects to login page', () => {
|
||||
expect(routerPushMock).toBeCalledWith('/login')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ export default {
|
||||
.catch(() => {
|
||||
this.$sidebar.displaySidebar(false)
|
||||
this.$store.dispatch('logout')
|
||||
this.$router.push('/login')
|
||||
if (this.$router.currentRoute.path !== '/login') this.$router.push('/login')
|
||||
})
|
||||
},
|
||||
async updateTransactions(pagination) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user