Skip to content

Commit 73ba7fd

Browse files
committed
fix(firebaseui): show error msgs when submitting empty sign in form
1 parent 9fea1bb commit 73ba7fd

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

Diff for: src/auth/module/components/auth/auth.component.html

+13-7
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
<!--Reset password tab-->
33
<ngb-tab *ngIf="passwordResetWished" title="Reset Password" id="reset_password">
44
<ng-template ngbTabContent>
5-
<form #formDir="ngForm" [formGroup]="resetPasswordFormGroup"
5+
<form #resetPasswordForm="ngForm"
6+
[formGroup]="resetPasswordFormGroup"
67
(ngSubmit)="resetPasswordFormGroup.valid && resetPassword()">
78

89
<div class="form-group is-invalid">
910
<label for="validationResetEmail">E-mail</label>
1011
<input class="form-control"
1112
[class.is-valid]="resetPasswordEmailFormControl.valid && resetPasswordEmailFormControl.dirty"
12-
[class.is-invalid]="resetPasswordEmailFormControl.errors && (resetPasswordEmailFormControl.dirty || formDir.submitted)"
13+
[class.is-invalid]="resetPasswordEmailFormControl.errors && (resetPasswordEmailFormControl.dirty || resetPasswordForm.submitted)"
1314
id="validationResetEmail"
1415
[formControl]="resetPasswordEmailFormControl"
1516
placeholder="E-mail"
@@ -19,7 +20,8 @@
1920

2021
<!--error msgs-->
2122
<div class="invalid-feedback"
22-
*ngIf="resetPasswordEmailFormControl.errors && (resetPasswordEmailFormControl.dirty || resetPasswordEmailFormControl.touched || formDir.submitted)">
23+
*ngIf="resetPasswordEmailFormControl.errors
24+
&& (resetPasswordEmailFormControl.dirty || resetPasswordEmailFormControl.touched || resetPasswordForm.submitted)">
2325
<p *ngIf="resetPasswordEmailFormControl.hasError('required')">
2426
E-mail is required
2527
</p>
@@ -51,7 +53,8 @@
5153
<ngb-tab>
5254
<ng-template ngbTabTitle>Sign in</ng-template>
5355
<ng-template ngbTabContent>
54-
<form [formGroup]="signInFormGroup"
56+
<form #signInPasswordForm="ngForm"
57+
[formGroup]="signInFormGroup"
5558
(ngSubmit)="signInFormGroup.valid &&
5659
authProcess.signInWith
5760
(authProviders.EmailAndPassword,signInFormGroup.value.email,signInFormGroup.value.password)">
@@ -61,7 +64,8 @@
6164
<div class="input-group">
6265
<input class="form-control"
6366
[class.is-valid]="signInEmailFormControl.valid && signInEmailFormControl.dirty"
64-
[class.is-invalid]="signInEmailFormControl.errors && signInEmailFormControl.dirty"
67+
[class.is-invalid]="signInEmailFormControl.errors
68+
&& (signInEmailFormControl.dirty || signInPasswordForm.submitted)"
6569
id="validationSignInEmail"
6670
[formControl]="signInEmailFormControl"
6771
placeholder="E-mail"
@@ -71,7 +75,8 @@
7175

7276
<!--error msgs-->
7377
<div class="invalid-feedback"
74-
*ngIf="signInEmailFormControl.errors && (signInEmailFormControl.dirty || signInEmailFormControl.touched)">
78+
*ngIf="signInEmailFormControl.errors
79+
&& (signInEmailFormControl.dirty || signInEmailFormControl.touched || signInPasswordForm.submitted)">
7580
<p *ngIf="signInEmailFormControl.hasError('required')">
7681
E-mail is required
7782
</p>
@@ -102,7 +107,8 @@
102107
<!--</small>-->
103108

104109
<div class="invalid-feedback"
105-
*ngIf="sigInPasswordFormControl.errors && (sigInPasswordFormControl.dirty || sigInPasswordFormControl.touched)">
110+
*ngIf="sigInPasswordFormControl.errors
111+
&& (sigInPasswordFormControl.dirty || sigInPasswordFormControl.touched || signInPasswordForm.submitted)">
106112
<p *ngIf="sigInPasswordFormControl.hasError('required')">
107113
Please do not forget the password
108114
</p>

0 commit comments

Comments
 (0)