Browse Source

Bugfix/limit cookie clearance in sign-out logic (#8350)

* Delete Bull Board cookie

* Update changelog
pull/8344/head
Thomas Kaul 4 days ago
committed by GitHub
parent
commit
6ddb36ae75
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      CHANGELOG.md
  2. 26
      apps/client/src/app/services/user/user.service.ts

4
CHANGELOG.md

@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Upgraded `uuid` from version `14.0.2` to `14.0.3` - Upgraded `uuid` from version `14.0.2` to `14.0.3`
- Upgraded `yahoo-finance2` from version `4.0.2` to `4.0.5` - Upgraded `yahoo-finance2` from version `4.0.2` to `4.0.5`
### Fixed
- Fixed the sign-out logic which deleted all cookies of the origin and did not delete the _Bull Board_ cookie on plain HTTP
## 3.94.0 - 2026-10-28 ## 3.94.0 - 2026-10-28
### Changed ### Changed

26
apps/client/src/app/services/user/user.service.ts

@ -1,5 +1,6 @@
import { KEY_SUBSCRIPTION_INTERSTITIAL_SHOWN } from '@ghostfolio/client/services/settings-storage.service'; import { KEY_SUBSCRIPTION_INTERSTITIAL_SHOWN } from '@ghostfolio/client/services/settings-storage.service';
import { WebAuthnService } from '@ghostfolio/client/services/web-authn.service'; import { WebAuthnService } from '@ghostfolio/client/services/web-authn.service';
import { BULL_BOARD_COOKIE_NAME } from '@ghostfolio/common/config';
import { Filter, User } from '@ghostfolio/common/interfaces'; import { Filter, User } from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { hasPermission, permissions } from '@ghostfolio/common/permissions';
@ -109,7 +110,7 @@ export class UserService extends ObservableStore<UserStoreState> {
window.localStorage.clear(); window.localStorage.clear();
window.sessionStorage.clear(); window.sessionStorage.clear();
void this.clearAllCookies(); this.clearBullBoardCookie();
this.reset(); this.reset();
@ -118,27 +119,8 @@ export class UserService extends ObservableStore<UserStoreState> {
} }
} }
private async clearAllCookies() { private clearBullBoardCookie() {
if (!('cookieStore' in window)) { document.cookie = `${BULL_BOARD_COOKIE_NAME}=; Max-Age=0; path=/`;
console.warn('Cookie Store API not available in this browser');
return;
}
const cookies = await cookieStore.getAll();
const cookieNames = cookies
.map(({ name }) => {
return name;
})
.filter((name): name is string => {
return !!name;
});
await Promise.all(
cookieNames.map((name) => {
return cookieStore.delete(name);
})
);
} }
private fetchUser(): Observable<User> { private fetchUser(): Observable<User> {

Loading…
Cancel
Save