@firestitch/2fa 12.0.4 → 12.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/components/2fa-verification/2fa-verification.component.d.ts +32 -26
- package/app/components/2fa-verification-code/2fa-verification-code.component.d.ts +18 -11
- package/app/components/2fa-verification-methods/2fa-verification-methods.component.d.ts +23 -23
- package/app/enums/verification-method-type.enum.d.ts +5 -6
- package/app/fs-2fa.module.d.ts +23 -23
- package/app/interfaces/verification-method.interface.d.ts +11 -11
- package/app/interfaces/verification-provider.interface.d.ts +8 -8
- package/app/tokens/verification.token.d.ts +3 -3
- package/bundles/firestitch-2fa.umd.js +291 -294
- package/bundles/firestitch-2fa.umd.js.map +1 -1
- package/esm2015/app/components/2fa-verification/2fa-verification.component.js +106 -92
- package/esm2015/app/components/2fa-verification-code/2fa-verification-code.component.js +60 -45
- package/esm2015/app/components/2fa-verification-methods/2fa-verification-methods.component.js +73 -73
- package/esm2015/app/enums/verification-method-type.enum.js +7 -8
- package/esm2015/app/fs-2fa.module.js +88 -91
- package/esm2015/app/interfaces/verification-method.interface.js +1 -1
- package/esm2015/app/interfaces/verification-provider.interface.js +1 -1
- package/esm2015/app/tokens/verification.token.js +2 -2
- package/esm2015/firestitch-2fa.js +4 -4
- package/esm2015/public_api.js +8 -8
- package/fesm2015/firestitch-2fa.js +275 -276
- package/fesm2015/firestitch-2fa.js.map +1 -1
- package/firestitch-2fa.d.ts +5 -5
- package/package.json +1 -1
- package/public_api.d.ts +6 -6
- package/app/components/2fa-verification-otp/2fa-verification-otp.component.d.ts +0 -12
- package/esm2015/app/components/2fa-verification-otp/2fa-verification-otp.component.js +0 -33
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firestitch-2fa.umd.js","sources":["../../src/app/tokens/verification.token.ts","../../src/app/enums/verification-method-type.enum.ts","../../src/app/components/2fa-verification-methods/2fa-verification-methods.component.ts","../../src/app/components/2fa-verification-methods/2fa-verification-methods.component.html","../../src/app/components/2fa-verification-otp/2fa-verification-otp.component.ts","../../src/app/components/2fa-verification-otp/2fa-verification-otp.component.html","../../src/app/components/2fa-verification-code/2fa-verification-code.component.ts","../../src/app/components/2fa-verification-code/2fa-verification-code.component.html","../../src/app/components/2fa-verification/2fa-verification.component.ts","../../src/app/components/2fa-verification/2fa-verification.component.html","../../src/app/fs-2fa.module.ts","../../src/public_api.ts","../../src/firestitch-2fa.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { IFsVerificationProvider } from '../interfaces/verification-provider.interface';\n\nexport const FS_2FA_VERIFICATION_PROVIDER = new InjectionToken<IFsVerificationProvider>(\n 'Provider for Verification service',\n);\n","export enum FsVerificationMethodType {\n Sms = 'sms',\n Email = 'email',\n Authenticator = 'authenticator',\n Code = 'code',\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n Inject,\n} from '@angular/core';\n\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\n\nimport { Observable } from 'rxjs';\nimport { map, shareReplay, tap } from 'rxjs/operators';\n\nimport { FS_2FA_VERIFICATION_PROVIDER } from '../../tokens/verification.token';\nimport { FsVerificationMethodType } from '../../enums/verification-method-type.enum';\nimport { IFsVerificationProvider } from '../../interfaces/verification-provider.interface';\nimport { IFsVerificationMethod } from '../../interfaces/verification-method.interface';\n\n\n@Component({\n templateUrl: './2fa-verification-methods.component.html',\n styleUrls: [\n './2fa-verification-methods.component.scss',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Fs2FaVerificationMethodsComponent {\n\n public method: IFsVerificationMethod;\n public phone: string;\n public code: string;\n public methods$: Observable<Record<string, IFsVerificationMethod[]>>;\n public readonly verificationMethodType = FsVerificationMethodType;\n\n constructor(\n @Inject(FS_2FA_VERIFICATION_PROVIDER)\n private _verificationProvider: IFsVerificationProvider,\n @Inject(MAT_DIALOG_DATA)\n private _dialogData: any,\n private _dialogRef: MatDialogRef<Fs2FaVerificationMethodsComponent>,\n ) {\n this._setActiveMethod();\n this._initMethods();\n }\n\n public compareWith(o1, o2) {\n return o1 && o2 && o1.id === o2.id\n }\n\n public setVerificationMethod = () => {\n return this._verificationProvider\n .updateVerificationMethod(this.method.id)\n .pipe(\n tap((method: IFsVerificationMethod) => {\n this._dialogRef.close(method);\n })\n );\n };\n\n private _setActiveMethod(): void {\n this.method = this._dialogData?.method;\n }\n\n private _initMethods(): void {\n this.methods$ = this._verificationProvider\n .methods()\n .pipe(\n map((methods) => {\n return methods\n .reduce((acc, method) => {\n if (!acc[method.type]) {\n acc[method.type] = [];\n }\n\n acc[method.type].push(method);\n\n return acc;\n }, {});\n }),\n shareReplay(1),\n );\n }\n}\n","<fs-dialog>\n <h1 mat-dialog-title>\n Verification Methods\n </h1>\n <form fsForm [submit]=\"setVerificationMethod\">\n <mat-dialog-content>\n <ng-container *fsSkeleton=\"methods$ | async as methods\">\n <fs-radio-group [(ngModel)]=\"method\" name=\"method\" [compareWith]=\"compareWith\">\n <ng-container *ngFor=\"let methodMap of methods | keyvalue\">\n <div class=\"method\">\n <ng-container [ngSwitch]=\"methodMap.key\">\n <ng-container *ngSwitchCase=\"verificationMethodType.Sms\">\n <div class=\"method-header\">\n <div class=\"method-icon\">\n <mat-icon>\n smartphone\n </mat-icon>\n </div>\n <div class=\"method-name\">\n <div class=\"method-title\">Text Message</div>\n <div class=\"method-subtitle\">\n Verification code send to one of following mobile number\n </div>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"verificationMethodType.Email\">\n <div class=\"method-header\">\n <div class=\"method-icon\">\n <mat-icon>\n mail\n </mat-icon>\n </div>\n <div class=\"method-name\">\n <div class=\"method-title\">Email</div>\n <div class=\"method-subtitle\">\n Verification code send to one of following email\n </div>\n </div>\n </div>\n </ng-container>\n </ng-container>\n\n <ng-container [ngSwitch]=\"methodMap.key\">\n <ng-container *ngSwitchCase=\"verificationMethodType.Sms\">\n <mat-radio-button class=\"method-item\" *ngFor=\"let method of methodMap.value\" [value]=\"method\">\n {{ method.phoneNumber }}\n </mat-radio-button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"verificationMethodType.Email\">\n <mat-radio-button class=\"method-item\" *ngFor=\"let method of methodMap.value\" [value]=\"method\">\n {{ method.email }}\n </mat-radio-button>\n </ng-container>\n </ng-container>\n </div>\n </ng-container>\n </fs-radio-group>\n </ng-container>\n </mat-dialog-content>\n <mat-dialog-actions>\n <div class=\"actions\">\n <ng-container *ngIf=\"methods$ | async\">\n <button mat-button type=\"submit\" color=\"primary\">Next</button>\n </ng-container>\n <button mat-button type=\"button\" [mat-dialog-close]=\"null\">Cancel</button>\n </div>\n </mat-dialog-actions>\n </form>\n</fs-dialog>\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Output,\n} from '@angular/core';\n\nimport { FsFormDirective } from '@firestitch/form';\n\n\n@Component({\n selector: 'fs-2fa-verification-otp',\n templateUrl: './2fa-verification-otp.component.html',\n styleUrls: [\n './2fa-verification-otp.component.scss'\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Fs2FAVerificationOTPComponent {\n\n @Output()\n public codeChange = new EventEmitter<string>();\n\n constructor(\n public form: FsFormDirective,\n ) {}\n\n public codeChanged(event: string): void {\n this.codeChange.emit(event);\n this.form.dirty();\n }\n\n public codeCompleted(): void {\n this.form.triggerSubmit();\n }\n}\n","<p class=\"description\">\n Enter the verification code generated by your 2 factor authenticator\n app to verify it's you\n</p>\n\n<!--\n<code-input [initialFocusField]=\"0\"\n [codeLength]=\"6\"\n (codeChanged)=\"codeChanged($event)\"\n (codeCompleted)=\"codeCompleted()\">>\n</code-input>\n-->\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\nimport { ControlContainer, NgForm } from '@angular/forms';\n\nimport { IFsVerificationMethod } from '../../interfaces/verification-method.interface';\n\n\n@Component({\n selector: 'fs-2fa-verification-code',\n templateUrl: './2fa-verification-code.component.html',\n styleUrls: [\n './2fa-verification-code.component.scss',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n viewProviders: [\n {\n provide: ControlContainer,\n useExisting: NgForm,\n },\n ],\n})\nexport class Fs2FAVerificationSMSComponent {\n\n @Input()\n public method: IFsVerificationMethod;\n\n @Output()\n public codeChange = new EventEmitter<string>();\n\n public code: string;\n\n public codeChanged(): void {\n this.codeChange.emit(this.code);\n }\n\n}\n","<p class=\"description\">\n <ng-container *ngIf=\"method.phoneNumber && method.type === 'sms'\">\n A text message with a verification code was just\n sent to <span style=\"white-space: nowrap;\">{{ method.phoneNumber }}</span> to verify it's you.\n </ng-container>\n\n <ng-container *ngIf=\"method.type === 'email'\">\n A email with a verification code was just sent to {{ method.email }} to verify it's you.\n </ng-container>\n\n <ng-container *ngIf=\"false\">\n Enter the one time code generated by the app administrator to verify it's you.\n </ng-container>\n</p>\n\n<mat-form-field>\n <mat-label>Code</mat-label>\n <input type=\"text\"\n matInput\n name=\"code\"\n autocomplete=\"one-time-code\"\n [(ngModel)]=\"code\"\n (ngModelChange)=\"codeChanged()\"\n required\n placeholder=\"Enter the code\"\n inputmode=\"numeric\">\n</mat-form-field>\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Inject,\n Input,\n OnDestroy,\n Output,\n} from '@angular/core';\n\nimport { FsDialog } from '@firestitch/dialog';\n\nimport { filter, takeUntil, tap } from 'rxjs/operators';\n\nimport { IFsVerificationMethod } from '../../interfaces/verification-method.interface';\nimport { Fs2FaVerificationMethodsComponent } from '../2fa-verification-methods/2fa-verification-methods.component';\nimport { Subject } from 'rxjs';\nimport { FS_2FA_VERIFICATION_PROVIDER } from '../../tokens/verification.token';\nimport { IFsVerificationProvider } from '../../interfaces/verification-provider.interface';\n\n\n@Component({\n selector: 'fs-2fa-verification',\n templateUrl: './2fa-verification.component.html',\n styleUrls: [\n './2fa-verification.component.scss',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Fs2FAVerificationComponent implements OnDestroy {\n\n @Input()\n public method: IFsVerificationMethod;\n\n @Output()\n public verified = new EventEmitter<unknown>();\n\n @Output()\n public backToSignIn = new EventEmitter<void>();\n\n\n public resendInProgress = false;\n public trustedDevice = false;\n\n private _code: string;\n private _destroy$ = new Subject<void>();\n\n constructor(\n @Inject(FS_2FA_VERIFICATION_PROVIDER)\n public verificationProvider: IFsVerificationProvider,\n private _cdRef: ChangeDetectorRef,\n private _dialog: FsDialog,\n ) {}\n\n public ngOnDestroy(): void {\n this._destroy$.next();\n this._destroy$.complete();\n }\n\n public verify = () => {\n return this.verificationProvider\n .verify(this._code, this.trustedDevice)\n .pipe(\n tap((response) => {\n this.verified.emit(response);\n }),\n );\n };\n\n public codeChanged(code: string): void {\n this._code = code;\n }\n\n public resend(): void {\n this.resendInProgress = true;\n\n this.verificationProvider\n .resend()\n .pipe(\n takeUntil(this._destroy$),\n )\n .subscribe(() => {\n this.resendInProgress = false;\n\n this._cdRef.markForCheck();\n })\n }\n\n public showVerificationMethods(): void {\n this._dialog.open(\n Fs2FaVerificationMethodsComponent,\n {\n data: {\n method: this.method,\n }\n }\n )\n .afterClosed()\n .pipe(\n filter((method) => !!method),\n )\n .subscribe((method) => {\n this.method = method;\n\n this._cdRef.markForCheck();\n });\n }\n\n public toSignIn(): void {\n this.backToSignIn.emit();\n }\n\n}\n","<form fsForm [submit]=\"verify\" [dirtySubmitButton]=\"false\">\n <h2>2-Step Verification</h2>\n\n <div class=\"code-container\">\n <ng-container *ngIf=\"method.type === 'authenticator' else code\">\n <fs-2fa-verification-otp class=\"otp\"></fs-2fa-verification-otp>\n </ng-container>\n\n <ng-template #code>\n <fs-2fa-verification-code\n [method]=\"method\"\n (codeChange)=\"codeChanged($event)\">\n </fs-2fa-verification-code>\n </ng-template>\n </div>\n\n <div class=\"additional\">\n <mat-checkbox\n name=\"trust-device\"\n [(ngModel)]=\"trustedDevice\">\n Trust this device\n </mat-checkbox>\n\n <span matSuffix>\n <a mat-button\n type=\"button\"\n color=\"primary\"\n (click)=\"resend()\"\n [disabled]=\"resendInProgress\"\n class=\"resend-code-btn\">\n <ng-container *ngIf=\"!resendInProgress else sending\">\n Resend Code\n </ng-container>\n <ng-template #sending>\n <mat-spinner [diameter]=\"12\"></mat-spinner> Sending\n </ng-template>\n </a>\n </span>\n </div>\n\n <div class=\"actions\">\n <button mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Verify\n </button>\n\n <button mat-button type=\"button\" (click)=\"showVerificationMethods()\">\n Try other ways to verify\n </button>\n\n <button mat-button type=\"button\" (click)=\"toSignIn()\">\n Back to signin\n </button>\n </div>\n</form>\n","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\n\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\n\nimport { FsFormModule } from '@firestitch/form';\nimport { FsSkeletonModule } from '@firestitch/skeleton';\nimport { FsRadioGroupModule } from '@firestitch/radiogroup';\nimport { FsDialogModule } from '@firestitch/dialog';\n\n// import { CodeInputModule } from 'angular-code-input';\n\nimport { Fs2FAVerificationComponent } from './components/2fa-verification/2fa-verification.component';\nimport { Fs2FAVerificationSMSComponent } from './components/2fa-verification-code/2fa-verification-code.component';\nimport { Fs2FAVerificationOTPComponent } from './components/2fa-verification-otp/2fa-verification-otp.component';\nimport { Fs2FaVerificationMethodsComponent } from './components/2fa-verification-methods/2fa-verification-methods.component';\n\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n\n MatFormFieldModule,\n MatInputModule,\n MatButtonModule,\n\n FsFormModule,\n FsRadioGroupModule,\n FsDialogModule,\n\n // CodeInputModule,\n MatCheckboxModule,\n MatProgressSpinnerModule,\n FsSkeletonModule,\n FsSkeletonModule,\n MatIconModule,\n MatRadioModule,\n ],\n declarations: [\n Fs2FAVerificationComponent,\n\n Fs2FAVerificationSMSComponent,\n Fs2FAVerificationOTPComponent,\n Fs2FaVerificationMethodsComponent,\n ],\n exports: [\n Fs2FAVerificationComponent,\n ],\n providers: [],\n})\nexport class Fs2FaModule {}\n","/*\n * Public API Surface of fs-2fa\n */\n\nexport { Fs2FaModule } from './app/fs-2fa.module';\n\n// Components\nexport { Fs2FAVerificationComponent } from './app/components/2fa-verification/2fa-verification.component';\n\nexport { IFsVerificationProvider } from './app/interfaces/verification-provider.interface';\nexport { IFsVerificationMethod } from './app/interfaces/verification-method.interface';\n\nexport { FsVerificationMethodType } from './app/enums/verification-method-type.enum';\n\nexport { FS_2FA_VERIFICATION_PROVIDER } from './app/tokens/verification.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["InjectionToken","FsVerificationMethodType","tap","map","shareReplay","MAT_DIALOG_DATA","Component","ChangeDetectionStrategy","Inject","EventEmitter","Output","ControlContainer","NgForm","Input","Subject","takeUntil","filter","CommonModule","FormsModule","MatFormFieldModule","MatInputModule","MatButtonModule","FsFormModule","FsRadioGroupModule","FsDialogModule","MatCheckboxModule","MatProgressSpinnerModule","FsSkeletonModule","MatIconModule","MatRadioModule","NgModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAIa,4BAA4B,GAAG,IAAIA,iBAAc,CAC5D,mCAAmC;;ACLzBC;IAAZ,WAAY,wBAAwB;QAClC,uCAAW,CAAA;QACX,2CAAe,CAAA;QACf,2DAA+B,CAAA;QAC/B,yCAAa,CAAA;IACf,CAAC,EALWA,gCAAwB,KAAxBA,gCAAwB;;ICwBpC;QAQE,2CAEU,qBAA8C,EAE9C,WAAgB,EAChB,UAA2D;YALrE,iBASC;YAPS,0BAAqB,GAArB,qBAAqB,CAAyB;YAE9C,gBAAW,GAAX,WAAW,CAAK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BAAkB;YAClBC,mBAAc;;YAGdC,sBAAiB;YACjBC,2BAAwB;YACxBC,mBAAgB;YAChBA,mBAAgB;YAChBC,gBAAa;YACbC,iBAAc,aAUd,0BAA0B;oIAIjB,WAAW,aAFX,EAAE,YA9BJ;gBACPZ,gBAAY;gBACZC,cAAW;gBAEXC,uBAAkB;gBAClBC,mBAAc;gBACdC,oBAAe;gBAEfC,eAAY;gBACZC,qBAAkB;gBAClBC,mBAAc;;gBAGdC,sBAAiB;gBACjBC,2BAAwB;gBACxBC,mBAAgB;gBAChBA,mBAAgB;gBAChBC,gBAAa;gBACbC,iBAAc;aACf;sHAaU,WAAW;sBAjCvBC,WAAQ;uBAAC;wBACR,OAAO,EAAE;4BACPb,gBAAY;4BACZC,cAAW;4BAEXC,uBAAkB;4BAClBC,mBAAc;4BACdC,oBAAe;4BAEfC,eAAY;4BACZC,qBAAkB;4BAClBC,mBAAc;;4BAGdC,sBAAiB;4BACjBC,2BAAwB;4BACxBC,mBAAgB;4BAChBA,mBAAgB;4BAChBC,gBAAa;4BACbC,iBAAc;yBACf;wBACD,YAAY,EAAE;4BACZ,0BAA0B;4BAE1B,6BAA6B;4BAC7B,6BAA6B;4BAC7B,iCAAiC;yBAClC;wBACD,OAAO,EAAE;4BACP,0BAA0B;yBAC3B;wBACD,SAAS,EAAE,EAAE;qBACd;;;ICzDD;;;;ICAA;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"firestitch-2fa.umd.js","sources":["../../src/app/tokens/verification.token.ts","../../src/app/enums/verification-method-type.enum.ts","../../src/app/components/2fa-verification-methods/2fa-verification-methods.component.ts","../../src/app/components/2fa-verification-methods/2fa-verification-methods.component.html","../../src/app/components/2fa-verification-code/2fa-verification-code.component.ts","../../src/app/components/2fa-verification-code/2fa-verification-code.component.html","../../src/app/components/2fa-verification/2fa-verification.component.ts","../../src/app/components/2fa-verification/2fa-verification.component.html","../../src/app/fs-2fa.module.ts","../../src/public_api.ts","../../src/firestitch-2fa.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { IFsVerificationProvider } from '../interfaces/verification-provider.interface';\n\nexport const FS_2FA_VERIFICATION_PROVIDER = new InjectionToken<IFsVerificationProvider>(\n 'Provider for Verification service',\n);\n","export enum FsVerificationMethodType {\n Sms = 'sms',\n Email = 'email',\n App = 'app',\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n Inject,\n} from '@angular/core';\n\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\n\nimport { Observable } from 'rxjs';\nimport { map, shareReplay, tap } from 'rxjs/operators';\n\nimport { FS_2FA_VERIFICATION_PROVIDER } from '../../tokens/verification.token';\nimport { FsVerificationMethodType } from '../../enums/verification-method-type.enum';\nimport { IFsVerificationProvider } from '../../interfaces/verification-provider.interface';\nimport { IFsVerificationMethod } from '../../interfaces/verification-method.interface';\n\n\n@Component({\n templateUrl: './2fa-verification-methods.component.html',\n styleUrls: [\n './2fa-verification-methods.component.scss',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Fs2FaVerificationMethodsComponent {\n\n public method: IFsVerificationMethod;\n public phone: string;\n public code: string;\n public methods$: Observable<Record<string, IFsVerificationMethod[]>>;\n public readonly verificationMethodType = FsVerificationMethodType;\n\n constructor(\n @Inject(FS_2FA_VERIFICATION_PROVIDER)\n private _verificationProvider: IFsVerificationProvider,\n @Inject(MAT_DIALOG_DATA)\n private _dialogData: any,\n private _dialogRef: MatDialogRef<Fs2FaVerificationMethodsComponent>,\n ) {\n this._setActiveMethod();\n this._initMethods();\n }\n\n public compareWith(o1, o2) {\n return o1 && o2 && o1.id === o2.id\n }\n\n public setVerificationMethod = () => {\n return this._verificationProvider\n .updateVerificationMethod(this.method.id)\n .pipe(\n tap((method: IFsVerificationMethod) => {\n this._dialogRef.close(method);\n })\n );\n };\n\n private _setActiveMethod(): void {\n this.method = this._dialogData?.method;\n }\n\n private _initMethods(): void {\n this.methods$ = this._verificationProvider\n .methods()\n .pipe(\n map((methods) => {\n return methods\n .reduce((acc, method) => {\n if (!acc[method.type]) {\n acc[method.type] = [];\n }\n\n acc[method.type].push(method);\n\n return acc;\n }, {});\n }),\n shareReplay(1),\n );\n }\n}\n","<fs-dialog>\n <h1 mat-dialog-title>\n Verification Methods\n </h1>\n <form fsForm [submit]=\"setVerificationMethod\" [dirtySubmitButton]=\"false\">\n <mat-dialog-content>\n <ng-container *fsSkeleton=\"methods$ | async as methods\">\n <fs-radio-group [(ngModel)]=\"method\" name=\"method\" [compareWith]=\"compareWith\">\n <ng-container *ngFor=\"let methodMap of methods | keyvalue\">\n <div class=\"method\">\n <ng-container [ngSwitch]=\"methodMap.key\">\n <ng-container *ngSwitchCase=\"verificationMethodType.Sms\">\n <div class=\"method-header\">\n <div class=\"method-icon\">\n <mat-icon>\n textsms\n </mat-icon>\n </div>\n <div class=\"method-name\">\n <div class=\"method-title\">Text Message</div>\n <div class=\"method-subtitle\">\n Verification code send to one of following mobile number\n </div>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"verificationMethodType.Email\">\n <div class=\"method-header\">\n <div class=\"method-icon\">\n <mat-icon>\n mail\n </mat-icon>\n </div>\n <div class=\"method-name\">\n <div class=\"method-title\">Email</div>\n <div class=\"method-subtitle\">\n Verification code send to one of following email\n </div>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"verificationMethodType.App\">\n <div class=\"method-header\">\n <div class=\"method-icon\">\n <mat-icon>\n phone_iphone\n </mat-icon>\n </div>\n <div class=\"method-name\">\n <div class=\"method-title\">Authenticator App</div>\n <div class=\"method-subtitle\">\n Verification code generated by an authenticator app\n </div>\n </div>\n </div>\n </ng-container> \n </ng-container>\n\n <mat-radio-button class=\"method-item\" *ngFor=\"let method of methodMap.value\" [value]=\"method\">\n <ng-container [ngSwitch]=\"methodMap.key\">\n <ng-container *ngSwitchCase=\"verificationMethodType.Sms\">\n {{ method.phoneNumber }}\n </ng-container>\n <ng-container *ngSwitchCase=\"verificationMethodType.Email\">\n {{ method.email }}\n </ng-container>\n <ng-container *ngSwitchCase=\"verificationMethodType.App\">\n Authenticator App\n </ng-container> \n </ng-container>\n </mat-radio-button>\n </div>\n </ng-container>\n </fs-radio-group>\n </ng-container>\n </mat-dialog-content>\n <mat-dialog-actions>\n <div class=\"actions\">\n <ng-container *ngIf=\"methods$ | async\">\n <button mat-button type=\"submit\" color=\"primary\">Next</button>\n </ng-container>\n <button mat-button type=\"button\" [mat-dialog-close]=\"null\">Cancel</button>\n </div>\n </mat-dialog-actions>\n </form>\n</fs-dialog>\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n ViewChild,\n} from '@angular/core';\nimport { ControlContainer, NgForm } from '@angular/forms';\nimport { MatInput } from '@angular/material/input';\nimport { CodeInputComponent } from 'angular-code-input';\nimport { FsVerificationMethodType } from '../../enums/verification-method-type.enum';\n\nimport { IFsVerificationMethod } from '../../interfaces/verification-method.interface';\n\n\n@Component({\n selector: 'fs-2fa-verification-code',\n templateUrl: './2fa-verification-code.component.html',\n styleUrls: [\n './2fa-verification-code.component.scss',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n viewProviders: [\n {\n provide: ControlContainer,\n useExisting: NgForm,\n },\n ],\n})\nexport class Fs2FAVerificationCodeComponent {\n\n @ViewChild(CodeInputComponent)\n public codeInputComponent: CodeInputComponent;\n\n @Input()\n public method: IFsVerificationMethod;\n\n @Input()\n public code;\n\n @Output()\n public codeChange = new EventEmitter<string>();\n\n @Output()\n public codeComplete = new EventEmitter<void>();\n\n public FsVerificationMethodType = FsVerificationMethodType;\n\n public codeChanged(code): void {\n this.code = code;\n this.codeChange.emit(this.code);\n }\n\n public codeCompleted(): void {\n this.codeComplete.emit();\n }\n\n public focus(): void {\n this.codeInputComponent.focusOnField(0);\n }\n\n}\n","<ng-container *ngIf=\"method.phoneNumber && method.type === FsVerificationMethodType.Sms\">\n <p class=\"description\">\n A text message with a verification code was just\n sent to <span style=\"white-space: nowrap;\">{{ method.phoneNumber }}</span> to verify it's you.\n </p>\n\n <ng-container *ngTemplateOutlet=\"input\"></ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"method.type === FsVerificationMethodType.Email\">\n <p class=\"description\">\n A email with a verification code was just sent to {{ method.email }} to verify it's you.\n </p>\n <ng-container *ngTemplateOutlet=\"input\"></ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"method.type === FsVerificationMethodType.App\">\n <p class=\"description\">\n Enter the verification code generated by your 2 factor authenticator app to verify it's you.\n </p>\n <ng-container *ngTemplateOutlet=\"input\"></ng-container>\n</ng-container>\n\n\n<ng-template #input> \n <code-input \n [code]=\"code\"\n [initialFocusField]=\"0\"\n [codeLength]=\"6\"\n (codeChanged)=\"codeChanged($event)\"\n (codeCompleted)=\"codeCompleted()\">\n </code-input> \n</ng-template> ","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Inject,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n ViewChild,\n} from '@angular/core';\n\nimport { FsDialog } from '@firestitch/dialog';\n\nimport { filter, takeUntil, tap } from 'rxjs/operators';\n\nimport { IFsVerificationMethod } from '../../interfaces/verification-method.interface';\nimport { Fs2FaVerificationMethodsComponent } from '../2fa-verification-methods/2fa-verification-methods.component';\nimport { Subject } from 'rxjs';\nimport { FS_2FA_VERIFICATION_PROVIDER } from '../../tokens/verification.token';\nimport { IFsVerificationProvider } from '../../interfaces/verification-provider.interface';\nimport { FsVerificationMethodType } from '../../enums/verification-method-type.enum';\nimport { Fs2FAVerificationCodeComponent } from '../2fa-verification-code/2fa-verification-code.component';\nimport { NgControl, NgForm } from '@angular/forms';\n\n\n@Component({\n selector: 'fs-2fa-verification',\n templateUrl: './2fa-verification.component.html',\n styleUrls: [\n './2fa-verification.component.scss',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Fs2FAVerificationComponent implements OnDestroy, AfterViewInit {\n\n @ViewChild(Fs2FAVerificationCodeComponent)\n public verificationCodeComponent: Fs2FAVerificationCodeComponent;\n\n @Input()\n public method: IFsVerificationMethod;\n\n @Output()\n public verified = new EventEmitter<unknown>();\n\n public resendInProgress = false;\n public code = '';\n public trustedDevice = true;\n public FsVerificationMethodType = FsVerificationMethodType;\n\n private _destroy$ = new Subject<void>();\n\n constructor(\n @Inject(FS_2FA_VERIFICATION_PROVIDER)\n public verificationProvider: IFsVerificationProvider,\n private _cdRef: ChangeDetectorRef,\n private _dialog: FsDialog,\n @Optional() private _form: NgForm,\n ) {\n }\n\n public ngOnDestroy(): void {\n this._destroy$.next();\n this._destroy$.complete();\n }\n\n public verify = () => {\n return this.verificationProvider\n .verify(this.code, this.trustedDevice)\n .pipe(\n tap((response) => {\n this.verified.emit(response);\n }),\n );\n };\n\n public ngAfterViewInit(): void {\n this.verificationCodeComponent.focus(); \n }\n\n public codeChange(code: string): void {\n this.code = code;\n }\n\n public codeComplete(): void {\n if(this._form) {\n this._form.ngSubmit.next();\n }\n }\n\n public resend(): void {\n this.resendInProgress = true;\n this.code = '';\n \n this.verificationProvider\n .resend()\n .pipe(\n takeUntil(this._destroy$),\n )\n .subscribe(() => {\n this.resendInProgress = false; \n this._cdRef.markForCheck();\n })\n }\n\n public showVerificationMethods(): void {\n this._dialog.open(\n Fs2FaVerificationMethodsComponent,\n {\n data: {\n method: this.method,\n }\n }\n )\n .afterClosed()\n .pipe(\n filter((method) => !!method),\n )\n .subscribe((method) => {\n this.method = method;\n this.code = '';\n\n this._cdRef.markForCheck();\n\n setTimeout(() => {\n this.verificationCodeComponent.focus();\n });\n });\n }\n\n}\n","<div class=\"code-container\">\n <fs-2fa-verification-code\n [method]=\"method\"\n [code]=\"code\"\n (codeChange)=\"codeChange($event)\"\n (codeComplete)=\"codeComplete()\">\n </fs-2fa-verification-code>\n</div>\n\n<div class=\"additional\">\n <mat-checkbox\n name=\"trust-device\"\n [(ngModel)]=\"trustedDevice\">\n Trust this device\n </mat-checkbox>\n\n <span class=\"resend-code-btn\">\n <ng-container *ngIf=\"!resendInProgress else sending\">\n <a (click)=\"resend()\">\n Resend Code\n </a>\n </ng-container>\n <ng-template #sending>\n <mat-spinner [diameter]=\"12\"></mat-spinner> Sending\n </ng-template>\n </span>\n</div>","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\n\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\n\nimport { FsFormModule } from '@firestitch/form';\nimport { FsSkeletonModule } from '@firestitch/skeleton';\nimport { FsRadioGroupModule } from '@firestitch/radiogroup';\nimport { FsDialogModule } from '@firestitch/dialog';\n\nimport { CodeInputModule } from 'angular-code-input';\n\nimport { Fs2FAVerificationComponent } from './components/2fa-verification/2fa-verification.component';\nimport { Fs2FAVerificationCodeComponent } from './components/2fa-verification-code/2fa-verification-code.component';\nimport { Fs2FaVerificationMethodsComponent } from './components/2fa-verification-methods/2fa-verification-methods.component';\n\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n\n MatFormFieldModule,\n MatInputModule,\n MatButtonModule,\n\n FsFormModule,\n FsRadioGroupModule,\n FsDialogModule,\n\n CodeInputModule,\n MatCheckboxModule,\n MatProgressSpinnerModule,\n FsSkeletonModule,\n FsSkeletonModule,\n MatIconModule,\n MatRadioModule,\n ],\n declarations: [\n Fs2FAVerificationComponent,\n Fs2FAVerificationCodeComponent,\n Fs2FaVerificationMethodsComponent,\n ],\n exports: [\n Fs2FAVerificationComponent,\n ],\n providers: [],\n})\nexport class Fs2FaModule {}\n","/*\n * Public API Surface of fs-2fa\n */\n\nexport { Fs2FaModule } from './app/fs-2fa.module';\n\n// Components\nexport { Fs2FAVerificationComponent } from './app/components/2fa-verification/2fa-verification.component';\n\nexport { IFsVerificationProvider } from './app/interfaces/verification-provider.interface';\nexport { IFsVerificationMethod } from './app/interfaces/verification-method.interface';\n\nexport { FsVerificationMethodType } from './app/enums/verification-method-type.enum';\n\nexport { FS_2FA_VERIFICATION_PROVIDER } from './app/tokens/verification.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["InjectionToken","FsVerificationMethodType","tap","map","shareReplay","MAT_DIALOG_DATA","Component","ChangeDetectionStrategy","Inject","EventEmitter","CodeInputComponent","ControlContainer","NgForm","ViewChild","Input","Output","Subject","takeUntil","filter","Optional","CommonModule","FormsModule","MatFormFieldModule","MatInputModule","MatButtonModule","FsFormModule","FsRadioGroupModule","FsDialogModule","CodeInputModule","MatCheckboxModule","MatProgressSpinnerModule","FsSkeletonModule","MatIconModule","MatRadioModule","NgModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAIa,4BAA4B,GAAG,IAAIA,iBAAc,CAC5D,mCAAmC;;ACLzBC;IAAZ,WAAY,wBAAwB;QAClC,uCAAW,CAAA;QACX,2CAAe,CAAA;QACf,uCAAW,CAAA;IACb,CAAC,EAJWA,gCAAwB,KAAxBA,gCAAwB;;ICwBpC;QAQE,2CAEU,qBAA8C,EAE9C,WAAgB,EAChB,UAA2D;YALrE,iBASC;YAPS,0BAAqB,GAArB,qBAAqB,CAAyB;YAE9C,gBAAW,GAAX,WAAW,CAAK;YAChB,eAAU,GAAV,UAAU,CAAiD;YAPrD,2BAAsB,GAAGA,gCAAwB,CAAC;YAiB3D,0BAAqB,GAAG;gBAC7B,OAAO,KAAI,CAAC,qBAAqB;qBAC9B,wBAAwB,CAAC,KAAI,CAAC,MAAM,CAAC,EAAE,CAAC;qBACxC,IAAI,CACHC,aAAG,CAAC,UAAC,MAA6B;oBAChC,KAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;iBAC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,mBAAgB;YAChBC,gBAAa;YACbC,iBAAc,aAQd,0BAA0B;oIAIjB,WAAW,aAFX,EAAE,YA5BJ;gBACPb,gBAAY;gBACZC,cAAW;gBAEXC,4BAAkB;gBAClBC,oBAAc;gBACdC,kBAAe;gBAEfC,eAAY;gBACZC,qBAAkB;gBAClBC,mBAAc;gBAEdC,oBAAe;gBACfC,sBAAiB;gBACjBC,6BAAwB;gBACxBC,mBAAgB;gBAChBA,mBAAgB;gBAChBC,gBAAa;gBACbC,iBAAc;aACf;sHAWU,WAAW;sBA/BvBC,WAAQ;uBAAC;wBACR,OAAO,EAAE;4BACPd,gBAAY;4BACZC,cAAW;4BAEXC,4BAAkB;4BAClBC,oBAAc;4BACdC,kBAAe;4BAEfC,eAAY;4BACZC,qBAAkB;4BAClBC,mBAAc;4BAEdC,oBAAe;4BACfC,sBAAiB;4BACjBC,6BAAwB;4BACxBC,mBAAgB;4BAChBA,mBAAgB;4BAChBC,gBAAa;4BACbC,iBAAc;yBACf;wBACD,YAAY,EAAE;4BACZ,0BAA0B;4BAC1B,8BAA8B;4BAC9B,iCAAiC;yBAClC;wBACD,OAAO,EAAE;4BACP,0BAA0B;yBAC3B;wBACD,SAAS,EAAE,EAAE;qBACd;;;ICtDD;;;;ICAA;;;;;;;;;;;;;;"}
|
|
@@ -1,92 +1,106 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Inject, Input, Output, } from '@angular/core';
|
|
2
|
-
import { FsDialog } from '@firestitch/dialog';
|
|
3
|
-
import { filter, takeUntil, tap } from 'rxjs/operators';
|
|
4
|
-
import { Fs2FaVerificationMethodsComponent } from '../2fa-verification-methods/2fa-verification-methods.component';
|
|
5
|
-
import { Subject } from 'rxjs';
|
|
6
|
-
import { FS_2FA_VERIFICATION_PROVIDER } from '../../tokens/verification.token';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
13
|
-
import * as
|
|
14
|
-
import * as
|
|
15
|
-
import * as
|
|
16
|
-
import * as
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.verified = new EventEmitter();
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
-
this.trustedDevice =
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
this._destroy$.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
this.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
this.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
.
|
|
60
|
-
.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
1
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Inject, Input, Optional, Output, ViewChild, } from '@angular/core';
|
|
2
|
+
import { FsDialog } from '@firestitch/dialog';
|
|
3
|
+
import { filter, takeUntil, tap } from 'rxjs/operators';
|
|
4
|
+
import { Fs2FaVerificationMethodsComponent } from '../2fa-verification-methods/2fa-verification-methods.component';
|
|
5
|
+
import { Subject } from 'rxjs';
|
|
6
|
+
import { FS_2FA_VERIFICATION_PROVIDER } from '../../tokens/verification.token';
|
|
7
|
+
import { FsVerificationMethodType } from '../../enums/verification-method-type.enum';
|
|
8
|
+
import { Fs2FAVerificationCodeComponent } from '../2fa-verification-code/2fa-verification-code.component';
|
|
9
|
+
import { NgForm } from '@angular/forms';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "@firestitch/dialog";
|
|
12
|
+
import * as i2 from "@angular/forms";
|
|
13
|
+
import * as i3 from "../2fa-verification-code/2fa-verification-code.component";
|
|
14
|
+
import * as i4 from "@angular/material/checkbox";
|
|
15
|
+
import * as i5 from "@angular/material/progress-spinner";
|
|
16
|
+
import * as i6 from "@angular/common";
|
|
17
|
+
export class Fs2FAVerificationComponent {
|
|
18
|
+
constructor(verificationProvider, _cdRef, _dialog, _form) {
|
|
19
|
+
this.verificationProvider = verificationProvider;
|
|
20
|
+
this._cdRef = _cdRef;
|
|
21
|
+
this._dialog = _dialog;
|
|
22
|
+
this._form = _form;
|
|
23
|
+
this.verified = new EventEmitter();
|
|
24
|
+
this.resendInProgress = false;
|
|
25
|
+
this.code = '';
|
|
26
|
+
this.trustedDevice = true;
|
|
27
|
+
this.FsVerificationMethodType = FsVerificationMethodType;
|
|
28
|
+
this._destroy$ = new Subject();
|
|
29
|
+
this.verify = () => {
|
|
30
|
+
return this.verificationProvider
|
|
31
|
+
.verify(this.code, this.trustedDevice)
|
|
32
|
+
.pipe(tap((response) => {
|
|
33
|
+
this.verified.emit(response);
|
|
34
|
+
}));
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
ngOnDestroy() {
|
|
38
|
+
this._destroy$.next();
|
|
39
|
+
this._destroy$.complete();
|
|
40
|
+
}
|
|
41
|
+
ngAfterViewInit() {
|
|
42
|
+
this.verificationCodeComponent.focus();
|
|
43
|
+
}
|
|
44
|
+
codeChange(code) {
|
|
45
|
+
this.code = code;
|
|
46
|
+
}
|
|
47
|
+
codeComplete() {
|
|
48
|
+
if (this._form) {
|
|
49
|
+
this._form.ngSubmit.next();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
resend() {
|
|
53
|
+
this.resendInProgress = true;
|
|
54
|
+
this.code = '';
|
|
55
|
+
this.verificationProvider
|
|
56
|
+
.resend()
|
|
57
|
+
.pipe(takeUntil(this._destroy$))
|
|
58
|
+
.subscribe(() => {
|
|
59
|
+
this.resendInProgress = false;
|
|
60
|
+
this._cdRef.markForCheck();
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
showVerificationMethods() {
|
|
64
|
+
this._dialog.open(Fs2FaVerificationMethodsComponent, {
|
|
65
|
+
data: {
|
|
66
|
+
method: this.method,
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
.afterClosed()
|
|
70
|
+
.pipe(filter((method) => !!method))
|
|
71
|
+
.subscribe((method) => {
|
|
72
|
+
this.method = method;
|
|
73
|
+
this.code = '';
|
|
74
|
+
this._cdRef.markForCheck();
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
this.verificationCodeComponent.focus();
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
Fs2FAVerificationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FAVerificationComponent, deps: [{ token: FS_2FA_VERIFICATION_PROVIDER }, { token: i0.ChangeDetectorRef }, { token: i1.FsDialog }, { token: i2.NgForm, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
82
|
+
Fs2FAVerificationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2FAVerificationComponent, selector: "fs-2fa-verification", inputs: { method: "method" }, outputs: { verified: "verified" }, viewQueries: [{ propertyName: "verificationCodeComponent", first: true, predicate: Fs2FAVerificationCodeComponent, descendants: true }], ngImport: i0, template: "<div class=\"code-container\">\n <fs-2fa-verification-code\n [method]=\"method\"\n [code]=\"code\"\n (codeChange)=\"codeChange($event)\"\n (codeComplete)=\"codeComplete()\">\n </fs-2fa-verification-code>\n</div>\n\n<div class=\"additional\">\n <mat-checkbox\n name=\"trust-device\"\n [(ngModel)]=\"trustedDevice\">\n Trust this device\n </mat-checkbox>\n\n <span class=\"resend-code-btn\">\n <ng-container *ngIf=\"!resendInProgress else sending\">\n <a (click)=\"resend()\">\n Resend Code\n </a>\n </ng-container>\n <ng-template #sending>\n <mat-spinner [diameter]=\"12\"></mat-spinner> Sending\n </ng-template>\n </span>\n</div>", styles: [".code-container{text-align:center}.code-container .otp{margin-bottom:15px}.additional{display:flex;justify-content:space-between;align-items:baseline;margin-top:-5px}.additional .resend-code-btn{cursor:pointer;text-transform:none}.additional .resend-code-btn mat-spinner{display:inline-block;vertical-align:middle}\n"], components: [{ type: i3.Fs2FAVerificationCodeComponent, selector: "fs-2fa-verification-code", inputs: ["method", "code"], outputs: ["codeChange", "codeComplete"] }, { type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i5.MatSpinner, selector: "mat-spinner", inputs: ["color"] }], directives: [{ type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
83
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FAVerificationComponent, decorators: [{
|
|
84
|
+
type: Component,
|
|
85
|
+
args: [{
|
|
86
|
+
selector: 'fs-2fa-verification',
|
|
87
|
+
templateUrl: './2fa-verification.component.html',
|
|
88
|
+
styleUrls: [
|
|
89
|
+
'./2fa-verification.component.scss',
|
|
90
|
+
],
|
|
91
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
92
|
+
}]
|
|
93
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
94
|
+
type: Inject,
|
|
95
|
+
args: [FS_2FA_VERIFICATION_PROVIDER]
|
|
96
|
+
}] }, { type: i0.ChangeDetectorRef }, { type: i1.FsDialog }, { type: i2.NgForm, decorators: [{
|
|
97
|
+
type: Optional
|
|
98
|
+
}] }]; }, propDecorators: { verificationCodeComponent: [{
|
|
99
|
+
type: ViewChild,
|
|
100
|
+
args: [Fs2FAVerificationCodeComponent]
|
|
101
|
+
}], method: [{
|
|
102
|
+
type: Input
|
|
103
|
+
}], verified: [{
|
|
104
|
+
type: Output
|
|
105
|
+
}] } });
|
|
106
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMmZhLXZlcmlmaWNhdGlvbi5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvYXBwL2NvbXBvbmVudHMvMmZhLXZlcmlmaWNhdGlvbi8yZmEtdmVyaWZpY2F0aW9uLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL3NyYy9hcHAvY29tcG9uZW50cy8yZmEtdmVyaWZpY2F0aW9uLzJmYS12ZXJpZmljYXRpb24uY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUVMLHVCQUF1QixFQUN2QixpQkFBaUIsRUFDakIsU0FBUyxFQUNULFlBQVksRUFDWixNQUF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wicmVzZW5kLWNvZGUtYnRuXCI+XG4gICAgPG5nLWNvbnRhaW5lciAqbmdJZj1cIiFyZXNlbmRJblByb2dyZXNzIGVsc2Ugc2VuZGluZ1wiPlxuICAgICAgPGEgKGNsaWNrKT1cInJlc2VuZCgpXCI+XG4gICAgICAgIFJlc2VuZCBDb2RlXG4gICAgICA8L2E+XG4gICAgPC9uZy1jb250YWluZXI+XG4gICAgPG5nLXRlbXBsYXRlICNzZW5kaW5nPlxuICAgICAgPG1hdC1zcGlubmVyIFtkaWFtZXRlcl09XCIxMlwiPjwvbWF0LXNwaW5uZXI+IFNlbmRpbmdcbiAgICA8L25nLXRlbXBsYXRlPlxuICA8L3NwYW4+XG48L2Rpdj4iXX0=
|
|
@@ -1,45 +1,60 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, } from '@angular/core';
|
|
2
|
-
import { ControlContainer, NgForm } from '@angular/forms';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
this.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewChild, } from '@angular/core';
|
|
2
|
+
import { ControlContainer, NgForm } from '@angular/forms';
|
|
3
|
+
import { CodeInputComponent } from 'angular-code-input';
|
|
4
|
+
import { FsVerificationMethodType } from '../../enums/verification-method-type.enum';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import * as i1 from "angular-code-input";
|
|
7
|
+
import * as i2 from "@angular/common";
|
|
8
|
+
export class Fs2FAVerificationCodeComponent {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.codeChange = new EventEmitter();
|
|
11
|
+
this.codeComplete = new EventEmitter();
|
|
12
|
+
this.FsVerificationMethodType = FsVerificationMethodType;
|
|
13
|
+
}
|
|
14
|
+
codeChanged(code) {
|
|
15
|
+
this.code = code;
|
|
16
|
+
this.codeChange.emit(this.code);
|
|
17
|
+
}
|
|
18
|
+
codeCompleted() {
|
|
19
|
+
this.codeComplete.emit();
|
|
20
|
+
}
|
|
21
|
+
focus() {
|
|
22
|
+
this.codeInputComponent.focusOnField(0);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
Fs2FAVerificationCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FAVerificationCodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
26
|
+
Fs2FAVerificationCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2FAVerificationCodeComponent, selector: "fs-2fa-verification-code", inputs: { method: "method", code: "code" }, outputs: { codeChange: "codeChange", codeComplete: "codeComplete" }, viewQueries: [{ propertyName: "codeInputComponent", first: true, predicate: CodeInputComponent, descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"method.phoneNumber && method.type === FsVerificationMethodType.Sms\">\n <p class=\"description\">\n A text message with a verification code was just\n sent to <span style=\"white-space: nowrap;\">{{ method.phoneNumber }}</span> to verify it's you.\n </p>\n\n <ng-container *ngTemplateOutlet=\"input\"></ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"method.type === FsVerificationMethodType.Email\">\n <p class=\"description\">\n A email with a verification code was just sent to {{ method.email }} to verify it's you.\n </p>\n <ng-container *ngTemplateOutlet=\"input\"></ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"method.type === FsVerificationMethodType.App\">\n <p class=\"description\">\n Enter the verification code generated by your 2 factor authenticator app to verify it's you.\n </p>\n <ng-container *ngTemplateOutlet=\"input\"></ng-container>\n</ng-container>\n\n\n<ng-template #input> \n <code-input \n [code]=\"code\"\n [initialFocusField]=\"0\"\n [codeLength]=\"6\"\n (codeChanged)=\"codeChanged($event)\"\n (codeCompleted)=\"codeCompleted()\">\n </code-input> \n</ng-template> ", styles: ["mat-form-field{width:100%}mat-form-field ::ng-deep .mat-form-field-subscript-wrapper{min-height:unset!important}mat-form-field ::ng-deep .mat-form-field-subscript-wrapper .fs-form-error{padding-bottom:5px}code-input{margin-bottom:15px;--item-spacing: 10px;--item-height: 20px;--item-border: none;--item-border-bottom: 2px solid #949494;--item-border-has-value: none;--item-border-bottom-has-value: 2px solid #949494;--item-border-focused: none;--item-border-bottom-focused: 2px solid #0061AF;--item-shadow-focused: none;--item-border-radius: 0px}code-input ::ng-deep span:first-child{padding-left:0!important}code-input ::ng-deep span:last-child{padding-right:0!important}code-input ::ng-deep input{font-size:20px!important;height:40px!important;padding:0!important}\n"], components: [{ type: i1.CodeInputComponent, selector: "code-input", inputs: ["isNonDigitsCode", "codeLength", "inputType", "initialFocusField", "isCharsCode", "isCodeHidden", "isPrevFocusableAfterClearing", "isFocusingOnLastByClickIfFilled", "code", "disabled", "autocapitalize"], outputs: ["codeChanged", "codeCompleted"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], viewProviders: [
|
|
27
|
+
{
|
|
28
|
+
provide: ControlContainer,
|
|
29
|
+
useExisting: NgForm,
|
|
30
|
+
},
|
|
31
|
+
], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FAVerificationCodeComponent, decorators: [{
|
|
33
|
+
type: Component,
|
|
34
|
+
args: [{
|
|
35
|
+
selector: 'fs-2fa-verification-code',
|
|
36
|
+
templateUrl: './2fa-verification-code.component.html',
|
|
37
|
+
styleUrls: [
|
|
38
|
+
'./2fa-verification-code.component.scss',
|
|
39
|
+
],
|
|
40
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
41
|
+
viewProviders: [
|
|
42
|
+
{
|
|
43
|
+
provide: ControlContainer,
|
|
44
|
+
useExisting: NgForm,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
}]
|
|
48
|
+
}], propDecorators: { codeInputComponent: [{
|
|
49
|
+
type: ViewChild,
|
|
50
|
+
args: [CodeInputComponent]
|
|
51
|
+
}], method: [{
|
|
52
|
+
type: Input
|
|
53
|
+
}], code: [{
|
|
54
|
+
type: Input
|
|
55
|
+
}], codeChange: [{
|
|
56
|
+
type: Output
|
|
57
|
+
}], codeComplete: [{
|
|
58
|
+
type: Output
|
|
59
|
+
}] } });
|
|
60
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMmZhLXZlcmlmaWNhdGlvbi1jb2RlLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9hcHAvY29tcG9uZW50cy8yZmEtdmVyaWZpY2F0aW9uLWNvZGUvMmZhLXZlcmlmaWNhdGlvbi1jb2RlLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL3NyYy9hcHAvY29tcG9uZW50cy8yZmEtdmVyaWZpY2F0aW9uLWNvZGUvMmZhLXZlcmlmaWNhdGlvbi1jb2RlLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbX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