mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 03:17:33 +00:00
fix(console): show otp secret (#4030)
This commit is contained in:
@@ -5,8 +5,15 @@
|
|||||||
<div mat-dialog-content>
|
<div mat-dialog-content>
|
||||||
<div class="flex" *ngIf="data.clientId">
|
<div class="flex" *ngIf="data.clientId">
|
||||||
<span class="overflow-auto"><span class="desc">ClientId:</span> {{ data.clientId }}</span>
|
<span class="overflow-auto"><span class="desc">ClientId:</span> {{ data.clientId }}</span>
|
||||||
<button color="primary" [disabled]="copied === data.clientId" matTooltip="copy to clipboard" cnslCopyToClipboard
|
<button
|
||||||
[valueToCopy]="data.clientId" (copiedValue)="this.copied = $event" mat-icon-button>
|
color="primary"
|
||||||
|
[disabled]="copied === data.clientId"
|
||||||
|
matTooltip="copy to clipboard"
|
||||||
|
cnslCopyToClipboard
|
||||||
|
[valueToCopy]="data.clientId"
|
||||||
|
(copiedValue)="this.copied = $event"
|
||||||
|
mat-icon-button
|
||||||
|
>
|
||||||
<i *ngIf="copied !== data.clientId" class="las la-clipboard"></i>
|
<i *ngIf="copied !== data.clientId" class="las la-clipboard"></i>
|
||||||
<i *ngIf="copied === data.clientId" class="las la-clipboard-check"></i>
|
<i *ngIf="copied === data.clientId" class="las la-clipboard-check"></i>
|
||||||
</button>
|
</button>
|
||||||
@@ -14,8 +21,15 @@
|
|||||||
|
|
||||||
<div *ngIf="data.clientSecret; else showNoSecretInfo" class="flex">
|
<div *ngIf="data.clientSecret; else showNoSecretInfo" class="flex">
|
||||||
<span class="overflow-auto"><span class="desc cnsl-secondary-text">ClientSecret:</span> {{ data.clientSecret }}</span>
|
<span class="overflow-auto"><span class="desc cnsl-secondary-text">ClientSecret:</span> {{ data.clientSecret }}</span>
|
||||||
<button color="primary" [disabled]="copied === data.clientSecret" matTooltip="copy to clipboard" cnslCopyToClipboard
|
<button
|
||||||
[valueToCopy]="data.clientSecret" (copiedValue)="this.copied = $event" mat-icon-button>
|
color="primary"
|
||||||
|
[disabled]="copied === data.clientSecret"
|
||||||
|
matTooltip="copy to clipboard"
|
||||||
|
cnslCopyToClipboard
|
||||||
|
[valueToCopy]="data.clientSecret"
|
||||||
|
(copiedValue)="this.copied = $event"
|
||||||
|
mat-icon-button
|
||||||
|
>
|
||||||
<i *ngIf="copied !== data.clientSecret" class="las la-clipboard"></i>
|
<i *ngIf="copied !== data.clientSecret" class="las la-clipboard"></i>
|
||||||
<i *ngIf="copied === data.clientSecret" class="las la-clipboard-check"></i>
|
<i *ngIf="copied === data.clientSecret" class="las la-clipboard-check"></i>
|
||||||
</button>
|
</button>
|
||||||
@@ -26,8 +40,14 @@
|
|||||||
</ng-template>
|
</ng-template>
|
||||||
</div>
|
</div>
|
||||||
<div mat-dialog-actions class="action">
|
<div mat-dialog-actions class="action">
|
||||||
<button cdkFocusInitial color="primary" mat-raised-button class="ok-button" (click)="closeDialog()"
|
<button
|
||||||
[attr.data-e2e]="'close-dialog'">
|
cdkFocusInitial
|
||||||
|
color="primary"
|
||||||
|
mat-raised-button
|
||||||
|
class="ok-button"
|
||||||
|
(click)="closeDialog()"
|
||||||
|
[attr.data-e2e]="'close-dialog'"
|
||||||
|
>
|
||||||
{{ 'ACTIONS.CLOSE' | translate }}
|
{{ 'ACTIONS.CLOSE' | translate }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
@@ -30,6 +30,22 @@
|
|||||||
|
|
||||||
<div class="qrcode-wrapper">
|
<div class="qrcode-wrapper">
|
||||||
<qr-code *ngIf="otpurl" class="qrcode" [value]="otpurl" [size]="150" [errorCorrectionLevel]="'M'"></qr-code>
|
<qr-code *ngIf="otpurl" class="qrcode" [value]="otpurl" [size]="150" [errorCorrectionLevel]="'M'"></qr-code>
|
||||||
|
|
||||||
|
<div class="otp-flex" *ngIf="otpsecret">
|
||||||
|
<span class="overflow-auto">{{ otpsecret }}</span>
|
||||||
|
<button
|
||||||
|
color="primary"
|
||||||
|
[disabled]="copied === otpsecret"
|
||||||
|
matTooltip="copy to clipboard"
|
||||||
|
cnslCopyToClipboard
|
||||||
|
[valueToCopy]="otpsecret"
|
||||||
|
(copiedValue)="this.copied = $event"
|
||||||
|
mat-icon-button
|
||||||
|
>
|
||||||
|
<i *ngIf="copied !== otpsecret" class="las la-clipboard"></i>
|
||||||
|
<i *ngIf="copied === otpsecret" class="las la-clipboard-check"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<cnsl-form-field class="formfield" label="Access Code" required="true">
|
<cnsl-form-field class="formfield" label="Access Code" required="true">
|
||||||
@@ -56,8 +72,14 @@
|
|||||||
{{ 'ACTIONS.CLOSE' | translate }}
|
{{ 'ACTIONS.CLOSE' | translate }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button *ngIf="selectedType !== undefined" cdkFocusInitial color="primary" mat-raised-button class="ok-button"
|
<button
|
||||||
(click)="submitAuth()">
|
*ngIf="selectedType !== undefined"
|
||||||
|
cdkFocusInitial
|
||||||
|
color="primary"
|
||||||
|
mat-raised-button
|
||||||
|
class="ok-button"
|
||||||
|
(click)="submitAuth()"
|
||||||
|
>
|
||||||
{{ 'ACTIONS.CREATE' | translate }}
|
{{ 'ACTIONS.CREATE' | translate }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
@@ -33,6 +33,29 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
.qrcode-wrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.otp-flex {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border: 1px solid #ffffff20;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
padding-left: 0.5rem;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.overflow-auto {
|
||||||
|
overflow: auto;
|
||||||
|
|
||||||
|
.desc {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.u2f {
|
.u2f {
|
||||||
|
@@ -20,6 +20,8 @@ export enum AuthFactorType {
|
|||||||
})
|
})
|
||||||
export class AuthFactorDialogComponent {
|
export class AuthFactorDialogComponent {
|
||||||
public otpurl: string = '';
|
public otpurl: string = '';
|
||||||
|
public otpsecret: string = '';
|
||||||
|
|
||||||
public otpcode: string = '';
|
public otpcode: string = '';
|
||||||
|
|
||||||
public u2fname: string = '';
|
public u2fname: string = '';
|
||||||
@@ -29,6 +31,8 @@ export class AuthFactorDialogComponent {
|
|||||||
|
|
||||||
AuthFactorType: any = AuthFactorType;
|
AuthFactorType: any = AuthFactorType;
|
||||||
selectedType!: AuthFactorType;
|
selectedType!: AuthFactorType;
|
||||||
|
|
||||||
|
public copied: string = '';
|
||||||
constructor(
|
constructor(
|
||||||
private authService: GrpcAuthService,
|
private authService: GrpcAuthService,
|
||||||
private toast: ToastService,
|
private toast: ToastService,
|
||||||
@@ -48,6 +52,7 @@ export class AuthFactorDialogComponent {
|
|||||||
this.authService.addMyMultiFactorOTP().then(
|
this.authService.addMyMultiFactorOTP().then(
|
||||||
(otpresp) => {
|
(otpresp) => {
|
||||||
this.otpurl = otpresp.url;
|
this.otpurl = otpresp.url;
|
||||||
|
this.otpsecret = otpresp.secret;
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
this.toast.showError(error);
|
this.toast.showError(error);
|
||||||
|
Reference in New Issue
Block a user