Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: user reset after logout #11058

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/bugfix-resetting-user-after-logout
Original file line number Diff line number Diff line change
@@ -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
7 changes: 6 additions & 1 deletion packages/web-pkg/src/composables/piniaStores/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ export const useUserStore = defineStore('user', () => {
sentrySetUser({ username: data.onPremisesSamAccountName })
}

const reset = () => {
user.value = null
}

return {
user,
setUser
setUser,
reset
}
})

Expand Down
2 changes: 1 addition & 1 deletion packages/web-runtime/src/services/auth/authService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down