Browse Source

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
pull/25701/head
sumeyye 3 months ago
committed by GitHub
parent
commit
449f61c30d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 17
      npm/ng-packs/packages/oauth/src/lib/services/memory-token-storage.service.ts

17
npm/ng-packs/packages/oauth/src/lib/services/memory-token-storage.service.ts

@ -193,15 +193,26 @@ export class MemoryTokenStorageService implements OAuthStorage {
}
private getSessionItem(key: string): string | null {
return this.getSessionStorage()?.getItem(key) ?? null;
const storage = this.getSessionStorage();
return storage ? storage.getItem(key) : this.localStorageService.getItem(key);
}
private setSessionItem(key: string, value: string): void {
this.getSessionStorage()?.setItem(key, value);
const storage = this.getSessionStorage();
if (storage) {
storage.setItem(key, value);
} else {
this.localStorageService.setItem(key, value);
}
}
private removeSessionItem(key: string): void {
this.getSessionStorage()?.removeItem(key);
const storage = this.getSessionStorage();
if (storage) {
storage.removeItem(key);
} else {
this.localStorageService.removeItem(key);
}
}
private createWorkerDataUrl(): string {

Loading…
Cancel
Save