diff options
Diffstat (limited to 'client/src/app/reset-password/reset-password.component.ts')
-rw-r--r-- | client/src/app/reset-password/reset-password.component.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/client/src/app/reset-password/reset-password.component.ts b/client/src/app/reset-password/reset-password.component.ts index 408374779..c8bd368c1 100644 --- a/client/src/app/reset-password/reset-password.component.ts +++ b/client/src/app/reset-password/reset-password.component.ts | |||
@@ -5,6 +5,7 @@ import { USER_PASSWORD, UserService } from '@app/shared' | |||
5 | import { NotificationsService } from 'angular2-notifications' | 5 | import { NotificationsService } from 'angular2-notifications' |
6 | import { AuthService } from '../core' | 6 | import { AuthService } from '../core' |
7 | import { FormReactive } from '../shared' | 7 | import { FormReactive } from '../shared' |
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
8 | 9 | ||
9 | @Component({ | 10 | @Component({ |
10 | selector: 'my-login', | 11 | selector: 'my-login', |
@@ -34,7 +35,8 @@ export class ResetPasswordComponent extends FormReactive implements OnInit { | |||
34 | private notificationsService: NotificationsService, | 35 | private notificationsService: NotificationsService, |
35 | private formBuilder: FormBuilder, | 36 | private formBuilder: FormBuilder, |
36 | private router: Router, | 37 | private router: Router, |
37 | private route: ActivatedRoute | 38 | private route: ActivatedRoute, |
39 | private i18n: I18n | ||
38 | ) { | 40 | ) { |
39 | super() | 41 | super() |
40 | } | 42 | } |
@@ -55,7 +57,7 @@ export class ResetPasswordComponent extends FormReactive implements OnInit { | |||
55 | this.verificationString = this.route.snapshot.queryParams['verificationString'] | 57 | this.verificationString = this.route.snapshot.queryParams['verificationString'] |
56 | 58 | ||
57 | if (!this.userId || !this.verificationString) { | 59 | if (!this.userId || !this.verificationString) { |
58 | this.notificationsService.error('Error', 'Unable to find user id or verification string.') | 60 | this.notificationsService.error(this.i18n('Error'), this.i18n('Unable to find user id or verification string.')) |
59 | this.router.navigate([ '/' ]) | 61 | this.router.navigate([ '/' ]) |
60 | } | 62 | } |
61 | } | 63 | } |
@@ -64,7 +66,7 @@ export class ResetPasswordComponent extends FormReactive implements OnInit { | |||
64 | this.userService.resetPassword(this.userId, this.verificationString, this.form.value.password) | 66 | this.userService.resetPassword(this.userId, this.verificationString, this.form.value.password) |
65 | .subscribe( | 67 | .subscribe( |
66 | () => { | 68 | () => { |
67 | this.notificationsService.success('Success', 'Your password has been successfully reset!') | 69 | this.notificationsService.success(this.i18n('Success'), this.i18n('Your password has been successfully reset!')) |
68 | this.router.navigate([ '/login' ]) | 70 | this.router.navigate([ '/login' ]) |
69 | }, | 71 | }, |
70 | 72 | ||