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 | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/client/src/app/reset-password/reset-password.component.ts b/client/src/app/reset-password/reset-password.component.ts index af1298de6..07b93ee73 100644 --- a/client/src/app/reset-password/reset-password.component.ts +++ b/client/src/app/reset-password/reset-password.component.ts | |||
@@ -1,8 +1,7 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { UserService, UserValidatorsService } from '@app/shared' | 3 | import { UserService, UserValidatorsService, FormReactive } from '@app/shared' |
4 | import { NotificationsService } from 'angular2-notifications' | 4 | import { Notifier } from '@app/core' |
5 | import { FormReactive } from '../shared' | ||
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
7 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 6 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' |
8 | import { ResetPasswordValidatorsService } from '@app/shared/forms/form-validators/reset-password-validators.service' | 7 | import { ResetPasswordValidatorsService } from '@app/shared/forms/form-validators/reset-password-validators.service' |
@@ -22,7 +21,7 @@ export class ResetPasswordComponent extends FormReactive implements OnInit { | |||
22 | private resetPasswordValidatorsService: ResetPasswordValidatorsService, | 21 | private resetPasswordValidatorsService: ResetPasswordValidatorsService, |
23 | private userValidatorsService: UserValidatorsService, | 22 | private userValidatorsService: UserValidatorsService, |
24 | private userService: UserService, | 23 | private userService: UserService, |
25 | private notificationsService: NotificationsService, | 24 | private notifier: Notifier, |
26 | private router: Router, | 25 | private router: Router, |
27 | private route: ActivatedRoute, | 26 | private route: ActivatedRoute, |
28 | private i18n: I18n | 27 | private i18n: I18n |
@@ -40,7 +39,7 @@ export class ResetPasswordComponent extends FormReactive implements OnInit { | |||
40 | this.verificationString = this.route.snapshot.queryParams['verificationString'] | 39 | this.verificationString = this.route.snapshot.queryParams['verificationString'] |
41 | 40 | ||
42 | if (!this.userId || !this.verificationString) { | 41 | if (!this.userId || !this.verificationString) { |
43 | this.notificationsService.error(this.i18n('Error'), this.i18n('Unable to find user id or verification string.')) | 42 | this.notifier.error(this.i18n('Unable to find user id or verification string.')) |
44 | this.router.navigate([ '/' ]) | 43 | this.router.navigate([ '/' ]) |
45 | } | 44 | } |
46 | } | 45 | } |
@@ -49,11 +48,11 @@ export class ResetPasswordComponent extends FormReactive implements OnInit { | |||
49 | this.userService.resetPassword(this.userId, this.verificationString, this.form.value.password) | 48 | this.userService.resetPassword(this.userId, this.verificationString, this.form.value.password) |
50 | .subscribe( | 49 | .subscribe( |
51 | () => { | 50 | () => { |
52 | this.notificationsService.success(this.i18n('Success'), this.i18n('Your password has been successfully reset!')) | 51 | this.notifier.success(this.i18n('Your password has been successfully reset!')) |
53 | this.router.navigate([ '/login' ]) | 52 | this.router.navigate([ '/login' ]) |
54 | }, | 53 | }, |
55 | 54 | ||
56 | err => this.notificationsService.error('Error', err.message) | 55 | err => this.notifier.error(err.message) |
57 | ) | 56 | ) |
58 | } | 57 | } |
59 | 58 | ||