Browse Source

refactoring

pull/24050/head
erdemcaygor 12 months ago
parent
commit
e4e8da3911
  1. 6
      npm/ng-packs/packages/oauth/src/lib/services/memory-token-storage.service.ts
  2. 3
      npm/ng-packs/packages/oauth/src/lib/services/oauth.service.ts

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

@ -56,14 +56,10 @@ export class MemoryTokenStorageService implements OAuthStorage {
break; break;
} }
}; };
console.log('✅ Using SharedWorker for cross-tab token storage');
} catch (error) { } catch (error) {
console.warn('⚠️ SharedWorker failed:', error);
this.useSharedWorker = false; this.useSharedWorker = false;
} }
} else { } else {
console.warn('⚠️ SharedWorker not supported');
this.useSharedWorker = false; this.useSharedWorker = false;
} }
} }
@ -96,7 +92,7 @@ export class MemoryTokenStorageService implements OAuthStorage {
} }
if (this.useSharedWorker && this.port) { if (this.useSharedWorker && this.port) {
// this.cache.delete(key); this.cache.delete(key);
this.port.postMessage({ action: 'remove', key }); this.port.postMessage({ action: 'remove', key });
} else { } else {
this.cache.delete(key); this.cache.delete(key);

3
npm/ng-packs/packages/oauth/src/lib/services/oauth.service.ts

@ -113,7 +113,8 @@ export class AbpOAuthService implements IAuthService {
try { try {
return this.oAuthService.refreshToken(); return this.oAuthService.refreshToken();
} catch (error) { } catch (error) {
return Promise.resolve(); console.log("Error while refreshing token: ", error);
return Promise.reject();
} }
} }

Loading…
Cancel
Save