File

core/authentication/sms-challenge.component.ts

Metadata

Index

Properties
Methods
Inputs
Outputs

Constructor

constructor(loginService: LoginService, users: UserService, alert: AlertService)
Parameters :
Name Type Optional
loginService LoginService No
users UserService No
alert AlertService No

Inputs

credentials
Type : ICredentials

Outputs

onCancel
Type : EventEmitter

Methods

Async resendTFASms
resendTFASms()
Returns : any
Async verifyTFACode
verifyTFACode()
Returns : any

Properties

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>

results matching ""

    No results matching ""