fix(console): configWithPrompt cleanup (#3796)

* fix: configWithPrompt cleanup

* code dialog text

Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
Max Peintner 2022-06-10 14:59:52 +02:00 committed by GitHub
parent 11d24f6d8a
commit b1da8975f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 17 deletions

View File

@ -21,11 +21,10 @@ export class AuthGuard implements CanActivate {
const hint = route.queryParams['login_hint'];
const configWithPrompt: Partial<AuthConfig> = {
customQueryParams: {
// prompt: 'select_account',
} as any,
login_hint: hint,
},
};
(configWithPrompt as any).customQueryParams['login_hint'] = hint;
console.log('auth', hint);
console.log(`authenticate with login_hint: ${hint}`);
this.auth.authenticate(configWithPrompt);
} else {
return this.auth.authenticate();

View File

@ -50,15 +50,13 @@ export class AccountsCardComponent implements OnInit {
}
}
public selectAccount(loginHint?: string): void {
public selectAccount(loginHint: string): void {
const configWithPrompt: Partial<AuthConfig> = {
customQueryParams: {
// prompt: 'select_account',
} as any,
login_hint: loginHint,
},
};
if (loginHint) {
(configWithPrompt as any).customQueryParams['login_hint'] = loginHint;
}
(configWithPrompt as any).customQueryParams['login_hint'] = loginHint;
this.authService.authenticate(configWithPrompt);
}

View File

@ -1,7 +1,9 @@
<h1 mat-dialog-title>
<span>{{'USER.CODEDIALOG.TITLE' | translate}} {{data?.number}}</span>
<span
>{{ 'USER.CODEDIALOG.TITLE' | translate }} <span *ngIf="data?.number.phone">{{ data.number.phone }}</span></span
>
</h1>
<p class="desc cnsl-secondary-text">{{'USER.CODEDIALOG.DESCRIPTION' | translate}}</p>
<p class="desc cnsl-secondary-text">{{ 'USER.CODEDIALOG.DESCRIPTION' | translate }}</p>
<div mat-dialog-content>
<cnsl-form-field class="formfield">
<cnsl-label>{{ 'USER.CODEDIALOG.CODE' | translate }}</cnsl-label>
@ -10,11 +12,10 @@
</div>
<div mat-dialog-actions class="action">
<button color="primary" mat-stroked-button class="ok-button" (click)="closeDialog()">
{{'ACTIONS.CLOSE' | translate}}
{{ 'ACTIONS.CLOSE' | translate }}
</button>
<button [disabled]="!code" cdkFocusInitial color="primary" mat-raised-button class="ok-button"
(click)="closeDialog(code)">
{{'ACTIONS.OK' | translate}}
<button [disabled]="!code" cdkFocusInitial color="primary" mat-raised-button class="ok-button" (click)="closeDialog(code)">
{{ 'ACTIONS.OK' | translate }}
</button>
</div>