fix(console-v2): settings permission restriction, u2f naming, asset error handling (#3658)

* fix permission on nav

* restrict settings access

* fido table

* u2f i18n, permission

* factor, image fallback

Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
Max Peintner
2022-05-20 11:23:16 +02:00
committed by GitHub
co-authored by Livio Amstutz
parent 62c4a4d08d
commit 40d7dba574
41 changed files with 633 additions and 222 deletions
+2 -3
View File
@@ -1,5 +1,6 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { lastValueFrom } from 'rxjs';
import { PolicyComponentServiceType } from '../modules/policies/policy-component-types.enum';
import { Theme } from '../modules/policies/private-labeling-policy/private-labeling-policy.component';
@@ -80,9 +81,7 @@ export class AssetService {
}
private async getServiceUrl(): Promise<string> {
const url = await this.http
.get('./assets/environment.json')
.toPromise()
const url = await lastValueFrom(this.http.get('./assets/environment.json'))
.then((data: any) => {
if (data && data.api) {
return data.api;
@@ -251,6 +251,19 @@ export class GrpcAuthService {
.then((resp) => resp.toObject());
}
public loadMyUser(): void {
from(this.getMyUser())
.pipe(
map((resp) => resp.user),
catchError((_) => {
return of(undefined);
}),
)
.subscribe((user) => {
this.userSubject.next(user);
});
}
public getMyUser(): Promise<GetMyUserResponse.AsObject> {
return this.grpcService.auth.getMyUser(new GetMyUserRequest(), null).then((resp) => resp.toObject());
}