aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+login
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+login')
-rw-r--r--client/src/app/+login/login.component.ts17
1 files changed, 7 insertions, 10 deletions
diff --git a/client/src/app/+login/login.component.ts b/client/src/app/+login/login.component.ts
index e5a382218..e9336172e 100644
--- a/client/src/app/+login/login.component.ts
+++ b/client/src/app/+login/login.component.ts
@@ -5,7 +5,6 @@ import { AuthService, Notifier, RedirectService, UserService } from '@app/core'
5import { HooksService } from '@app/core/plugins/hooks.service' 5import { HooksService } from '@app/core/plugins/hooks.service'
6import { FormReactive, FormValidatorService, LoginValidatorsService } from '@app/shared/shared-forms' 6import { FormReactive, FormValidatorService, LoginValidatorsService } from '@app/shared/shared-forms'
7import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' 7import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { RegisteredExternalAuthConfig, ServerConfig } from '@shared/models' 8import { RegisteredExternalAuthConfig, ServerConfig } from '@shared/models'
10 9
11@Component({ 10@Component({
@@ -37,9 +36,8 @@ export class LoginComponent extends FormReactive implements OnInit, AfterViewIni
37 private userService: UserService, 36 private userService: UserService,
38 private redirectService: RedirectService, 37 private redirectService: RedirectService,
39 private notifier: Notifier, 38 private notifier: Notifier,
40 private hooks: HooksService, 39 private hooks: HooksService
41 private i18n: I18n 40 ) {
42 ) {
43 super() 41 super()
44 } 42 }
45 43
@@ -105,10 +103,9 @@ export class LoginComponent extends FormReactive implements OnInit, AfterViewIni
105 this.userService.askResetPassword(this.forgotPasswordEmail) 103 this.userService.askResetPassword(this.forgotPasswordEmail)
106 .subscribe( 104 .subscribe(
107 () => { 105 () => {
108 const message = this.i18n( 106 const message = $localize`An email with the reset password instructions will be sent to ${this.forgotPasswordEmail}.
109 'An email with the reset password instructions will be sent to {{email}}. The link will expire within 1 hour.', 107The link will expire within 1 hour.`
110 { email: this.forgotPasswordEmail } 108
111 )
112 this.notifier.success(message) 109 this.notifier.success(message)
113 this.hideForgotPasswordModal() 110 this.hideForgotPasswordModal()
114 }, 111 },
@@ -140,8 +137,8 @@ export class LoginComponent extends FormReactive implements OnInit, AfterViewIni
140 } 137 }
141 138
142 private handleError (err: any) { 139 private handleError (err: any) {
143 if (err.message.indexOf('credentials are invalid') !== -1) this.error = this.i18n('Incorrect username or password.') 140 if (err.message.indexOf('credentials are invalid') !== -1) this.error = $localize`Incorrect username or password.`
144 else if (err.message.indexOf('blocked') !== -1) this.error = this.i18n('Your account is blocked.') 141 else if (err.message.indexOf('blocked') !== -1) this.error = $localize`Your account is blocked.`
145 else this.error = err.message 142 else this.error = err.message
146 } 143 }
147} 144}