- this.authService.login(username, password).subscribe(
- result => this.router.navigate(['/videos/list']),
+ this.authService.login(username, password)
+ .subscribe(
+ () => this.redirectService.redirectToPreviousRoute(),
+
+ err => this.handleError(err)
+ )
+ }
+
+ askResetPassword () {
+ this.userService.askResetPassword(this.forgotPasswordEmail)
+ .subscribe(
+ () => {
+ const message = this.i18n(
+ 'An email with the reset password instructions will be sent to {{email}}. The link will expire within 1 hour.',
+ { email: this.forgotPasswordEmail }
+ )
+ this.notifier.success(message)
+ this.hideForgotPasswordModal()
+ },
+
+ err => this.notifier.error(err.message)
+ )
+ }
+
+ openForgotPasswordModal () {
+ this.openedForgotPasswordModal = this.modalService.open(this.forgotPasswordModal)
+ }
+
+ hideForgotPasswordModal () {
+ this.openedForgotPasswordModal.close()
+ }
+
+ private loadExternalAuthToken (username: string, token: string) {
+ this.isAuthenticatedWithExternalAuth = true
+
+ this.authService.login(username, null, token)
+ .subscribe(
+ () => this.redirectService.redirectToPreviousRoute(),