File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed
src/app/core/components/two-factor-auth Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change 5050 < option [disabled] ="hasMethod('email') " value ="email "> Email</ option >
5151 < option [disabled] ="hasMethod('sms') " value ="sms "> SMS</ option >
5252 </ select >
53- < form *ngIf ="method " [formGroup] ="form " (submit) ="submitData(form.value) ">
53+ < form
54+ class ="send-code-form "
55+ *ngIf ="method "
56+ [formGroup] ="form "
57+ (submit) ="sendCode(form.value) "
58+ >
5459 < p *ngIf ="!selectedMethodToDelete ">
5560 2. Enter your contact information for the preferred method below and click
5661 the button to send a one-time use code.
8590 </ div >
8691 < div class ="send-code-button button-container ">
8792 < button
93+ type ="submit "
8894 role ="button "
8995 [disabled] ="!form.value.contactInfo || form.get('contactInfo').errors "
90- (click) ="sendCode($event) "
9196 class ="btn btn-primary "
9297 >
9398 Send Code
9499 </ button >
95100 </ div >
96- < div class ="code-container " *ngIf ="codeSent ">
101+ </ form >
102+ < div class ="code-container " *ngIf ="codeSent ">
103+ < form (submit) ="submitData(form.value) ">
97104 < p > 3. Enter the four digit code below</ p >
98105 < div class ="input-group-vertical ">
99106 < pr-form-input
105112 </ div >
106113 < div class ="button-container button-group ">
107114 < button
108- type ="submit "
109115 [disabled] ="!form.value.code "
110116 class ="btn btn-primary "
117+ type ="submit "
111118 >
112119 {{ selectedMethodToDelete ? 'Delete' : 'Enable' }}
113120 </ button >
114- < button class ="btn btn-secondary " (click) ="cancel() "> Cancel</ button >
121+ < button type ="button " class ="btn btn-secondary " (click) ="cancel() ">
122+ Cancel
123+ </ button >
115124 </ div >
116- </ div >
117- </ form >
125+ </ form >
126+ </ div >
118127</ div >
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ export class TwoFactorAuthComponent implements OnInit {
4747 this . formatPhoneNumber ( value ) ;
4848 }
4949 } ) ;
50+
51+ this . form . get ( 'code' ) . valueChanges . subscribe ( ( ) => { } ) ;
5052 }
5153
5254 async ngOnInit ( ) {
@@ -108,8 +110,6 @@ export class TwoFactorAuthComponent implements OnInit {
108110 }
109111
110112 async sendCode ( e ) {
111- e . preventDefault ( ) ;
112-
113113 try {
114114 if ( this . selectedMethodToDelete ) {
115115 await this . api . idpuser . sendDisableCode (
You can’t perform that action at this time.
0 commit comments