diff --git a/changelog/unreleased/bugfix-resetting-user-after-logout b/changelog/unreleased/bugfix-resetting-user-after-logout new file mode 100644 index 00000000000..e0246780f9a --- /dev/null +++ b/changelog/unreleased/bugfix-resetting-user-after-logout @@ -0,0 +1,6 @@ +Bugfix: Resetting user after logout + +We've fixed a bug where the current user would not be resetted after logout. + +https://github.com/owncloud/web/pull/11058 +https://github.com/owncloud/web/issues/11055 diff --git a/packages/web-pkg/src/composables/piniaStores/user.ts b/packages/web-pkg/src/composables/piniaStores/user.ts index 99f47d652b2..dc10678982a 100644 --- a/packages/web-pkg/src/composables/piniaStores/user.ts +++ b/packages/web-pkg/src/composables/piniaStores/user.ts @@ -11,9 +11,14 @@ export const useUserStore = defineStore('user', () => { sentrySetUser({ username: data.onPremisesSamAccountName }) } + const reset = () => { + user.value = null + } + return { user, - setUser + setUser, + reset } }) diff --git a/packages/web-runtime/src/services/auth/authService.ts b/packages/web-runtime/src/services/auth/authService.ts index baaa0d8ae97..cb5fc88b1ac 100644 --- a/packages/web-runtime/src/services/auth/authService.ts +++ b/packages/web-runtime/src/services/auth/authService.ts @@ -330,7 +330,7 @@ export class AuthService implements AuthServiceInterface { private resetStateAfterUserLogout() { // TODO: create UserUnloadTask interface and allow registering unload-tasks in the authService - this.userStore.$reset() + this.userStore.reset() this.authStore.clearUserContext() }