core/authentication/sms-challenge.component.ts
selector | c8y-sms-challenge |
templateUrl | ./sms-challenge.component.html |
Properties |
|
Methods |
|
Inputs |
Outputs |
constructor(loginService: LoginService, users: UserService, alert: AlertService)
|
||||||||||||
Parameters :
|
credentials |
Type : ICredentials
|
onCancel |
Type : EventEmitter
|
Async resendTFASms |
resendTFASms()
|
Returns :
any
|
Async verifyTFACode |
verifyTFACode()
|
Returns :
any
|
isLoading |
Default value : false
|
Public loginService |
Type : LoginService
|
model |
Type : object
|
Default value : {
smsToken: ''
}
|
<form #twoFactorForm="ngForm" class="loginForm" (ngSubmit)="verifyTFACode()" novalidate>
<div class="legend form-block center" translate>Two-factor authentication</div>
<c8y-form-group>
<label translate>Verification code</label>
<input
[(ngModel)]="model.smsToken"
#sms_token="ngModel"
type="text"
name="sms_token"
autofocus
autocapitalize="off"
autocorrect="off"
class="form-control"
placeholder="{{ 'e.g.' | translate }} 624327"
required
/>
<p *ngIf="!twoFactorForm.form.valid || isLoading" class="help-block" translate>
Insert the code received via SMS.
</p>
</c8y-form-group>
<button
title="{{ 'Verify' | translate }}"
[disabled]="!twoFactorForm.form.valid || isLoading"
class="btn btn-primary btn-lg btn-block form-group"
>
{{ 'Verify' | translate }}
</button>
<div class="d-flex m-t-8">
<button
type="button"
title="{{ 'Send new code' | translate }}"
[ngClass]="{ disabled: isLoading }"
class="btn btn-link btn-sm"
(click)="resendTFASms()"
>
{{ 'Send new code' | translate }}
</button>
<button
type="button"
title="{{ 'Log in' | translate }}"
class="btn btn-link btn-sm"
(click)="onCancel.emit()"
>
{{ 'Log in' | translate }}
</button>
</div>
</form>