Skip to content

Commit de57dd0

Browse files
committed
fix(i18n): remove hardcoded error messages for password length
1 parent 47dc875 commit de57dd0

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/module/components/ngx-auth-firebaseui/auth.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@
7171
{{passwordErrorRequiredText}}
7272
</mat-error>
7373
<mat-error *ngIf="sigInPasswordFormControl.hasError('minlength')">
74-
The password must be at least {{ min }} characters long.
74+
{{ passwordErrorMinLengthText }}
7575
</mat-error>
7676
<mat-error *ngIf="sigInPasswordFormControl.hasError('maxlength')">
77-
The password must not exceed {{ max }} characters
77+
{{ passwordErrorMaxLengthText }}
7878
</mat-error>
7979
</mat-form-field>
8080

@@ -182,10 +182,10 @@
182182
</mat-error>
183183

184184
<mat-error *ngIf="sigUpPasswordFormControl.hasError('minlength')" class="cut-text">
185-
The password must be at least {{min}} characters long.
185+
{{ passwordErrorMinLengthText }}
186186
</mat-error>
187187
<mat-error *ngIf="sigUpPasswordFormControl.hasError('maxlength')" class="cut-text">
188-
The password can not be longer than {{max}} characters.
188+
{{ passwordErrorMaxLengthText }}
189189
</mat-error>
190190

191191
</mat-form-field>

src/module/components/ngx-auth-firebaseui/auth.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ export class AuthComponent implements OnInit, AfterViewInit, OnChanges, OnDestro
101101

102102
@Input() passwordText = 'Password';
103103
@Input() passwordErrorRequiredText = 'Password is required';
104+
@Input() passwordErrorMinLengthText = 'The password is too short!';
105+
@Input() passwordErrorMaxLengthText = 'The password is too long!';
104106

105107
// Register Tab
106108
@Input() registerTabText = 'Register';

src/module/guards/logged-in.guard.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Inject, Injectable } from '@angular/core';
2-
import { ActivatedRoute, ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router';
2+
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router';
33
import { Observable } from 'rxjs';
44
import { map } from 'rxjs/operators';
55
import { AuthProcessService, NgxAuthFirebaseUIConfig, NgxAuthFirebaseUIConfigToken } from '../ngx-auth-firebase-u-i.module';
@@ -12,7 +12,6 @@ export class LoggedInGuard implements CanActivate {
1212
@Inject(NgxAuthFirebaseUIConfigToken)
1313
private config: NgxAuthFirebaseUIConfig,
1414
private router: Router,
15-
private activatedRoute: ActivatedRoute,
1615
private authProcess: AuthProcessService
1716
) {}
1817

0 commit comments

Comments
 (0)