+ )
+ }
+
+ redirect () {
+ const redirect = this.authService.redirectUrl
+ if (redirect) {
+ this.router.navigate([ redirect ])
+ } else {
+ this.redirectService.redirectToHomepage()
+ }
+ }
+
+ askResetPassword () {
+ this.userService.askResetPassword(this.forgotPasswordEmail)
+ .subscribe(
+ () => {
+ const message = this.i18n(
+ 'An email with the reset password instructions will be sent to {{email}}.',
+ { email: this.forgotPasswordEmail }
+ )
+ this.notificationsService.success(this.i18n('Success'), message)
+ this.hideForgotPasswordModal()
+ },
+
+ err => this.notificationsService.error(this.i18n('Error'), err.message)
+ )
+ }
+
+ onForgotPasswordModalShown () {
+ this.forgotPasswordEmailInput.nativeElement.focus()
+ }
+
+ openForgotPasswordModal () {
+ this.openedForgotPasswordModal = this.modalService.open(this.forgotPasswordModal)
+ }
+
+ hideForgotPasswordModal () {
+ this.openedForgotPasswordModal.close()