fix: console v2 (#1454)

* some issues

* passwordless, mfa

* mfa, project fixes, login policy

* user table, auth service, interceptor
This commit is contained in:
Max Peintner
2021-03-23 09:50:58 +01:00
committed by GitHub
parent d5f0c2375a
commit 7768759906
40 changed files with 261 additions and 157 deletions
@@ -37,8 +37,6 @@ export class AuthenticationService {
public async authenticate(
partialConfig?: Partial<AuthConfig>,
setState: boolean = true,
force: boolean = false,
): Promise<boolean> {
if (partialConfig) {
Object.assign(this.authConfig, partialConfig);
@@ -50,8 +48,8 @@ export class AuthenticationService {
this._authenticated = this.oauthService.hasValidAccessToken();
if (!this.oauthService.hasValidIdToken() || !this.authenticated || partialConfig || force) {
const newState = setState ? await this.statehandler.createState().toPromise() : undefined;
if (!this.oauthService.hasValidIdToken() || !this.authenticated || partialConfig) {
const newState = await this.statehandler.createState().toPromise();
this.oauthService.initCodeFlow(newState);
}
this._authenticationChanged.next(this.authenticated);
@@ -253,6 +253,7 @@ export class GrpcAuthService {
firstName?: string,
lastName?: string,
nickName?: string,
displayName?: string,
preferredLanguage?: string,
gender?: Gender,
): Promise<UpdateMyProfileResponse.AsObject> {
@@ -266,6 +267,9 @@ export class GrpcAuthService {
if (nickName) {
req.setNickName(nickName);
}
if (displayName) {
req.setDisplayName(displayName);
}
if (gender) {
req.setGender(gender);
}
@@ -61,7 +61,7 @@ export class AuthInterceptor<TReq = unknown, TResp = unknown> implements UnaryIn
dialogRef.afterClosed().pipe(take(1)).subscribe(resp => {
if (resp) {
this.authenticationService.authenticate(undefined, true, true);
this.authenticationService.authenticate(undefined);
}
});
}