Add list of users from public keys.

This commit is contained in:
Spencer Ofwiti
2021-03-16 20:13:48 +03:00
parent 03be46e169
commit 6dc44be4eb
5 changed files with 31 additions and 62 deletions

View File

@@ -138,6 +138,12 @@ export class AuthService {
window.location.reload(true);
}
getTrustedUsers(): any {
let trustedUsers = [];
this.mutableKeyStore.getPublicKeys().forEach(key => trustedUsers.push(key.users[0].userId));
return trustedUsers;
}
async getPublicKeys(): Promise<void> {
this.httpWrapperService.get(`${environment.publicKeysUrl}`).pipe(first()).subscribe(async res => {
await this.mutableKeyStore.importPublicKey(res.body);