1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

Observable auth statuses (#8537)

* Observable has token

* Allow access to user key state observable

* Create observable auth status

* Fix DI
This commit is contained in:
Matt Gibson
2024-04-01 14:15:54 -05:00
committed by GitHub
parent c3c895230f
commit 136226b6be
12 changed files with 260 additions and 26 deletions

View File

@@ -160,6 +160,10 @@ export class CryptoService implements CryptoServiceAbstraction {
await this.setUserKey(key);
}
getInMemoryUserKeyFor$(userId: UserId): Observable<UserKey> {
return this.stateProvider.getUserState$(USER_KEY, userId);
}
async getUserKey(userId?: UserId): Promise<UserKey> {
let userKey = await firstValueFrom(this.stateProvider.getUserState$(USER_KEY, userId));
if (userKey) {