Skip to content

Commit 27e9dec

Browse files
authored
add error handler in user sse to logout and redirect to the home (#620)
1 parent f4aa99b commit 27e9dec

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

frontend/kubecloud/src/composables/useNotificationEvents.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ export function useNotificationEvents() {
175175
break
176176
case 'error':
177177
notificationStore.error(subject, message)
178+
if (type === 'user') {
179+
setTimeout(() => {
180+
userStore.logout()
181+
router.push('/')
182+
}, 2000)
183+
}
178184
break
179185
case 'warning':
180186
notificationStore.warning(subject, message)

0 commit comments

Comments
 (0)