aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/login/login.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-12-11 15:27:46 +0100
committerChocobozzz <me@florianbigard.com>2018-12-11 15:27:46 +0100
commitdae5ca24b173aebd16de2a202ccd4088568b8dfb (patch)
tree29d07d765478776b7c3f91f40443be1acb561df9 /client/src/app/login/login.component.ts
parentf481c4f9f31e897a08e818f388fecdee07f57142 (diff)
downloadPeerTube-dae5ca24b173aebd16de2a202ccd4088568b8dfb.tar.gz
PeerTube-dae5ca24b173aebd16de2a202ccd4088568b8dfb.tar.zst
PeerTube-dae5ca24b173aebd16de2a202ccd4088568b8dfb.zip
Redirect to the last url on login
Diffstat (limited to 'client/src/app/login/login.component.ts')
-rw-r--r--client/src/app/login/login.component.ts11
1 files changed, 1 insertions, 10 deletions
diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts
index 212a8ff1f..18f8f69e5 100644
--- a/client/src/app/login/login.component.ts
+++ b/client/src/app/login/login.component.ts
@@ -64,7 +64,7 @@ export class LoginComponent extends FormReactive implements OnInit {
64 64
65 this.authService.login(username, password) 65 this.authService.login(username, password)
66 .subscribe( 66 .subscribe(
67 () => this.redirect(), 67 () => this.redirectService.redirectToPreviousRoute(),
68 68
69 err => { 69 err => {
70 if (err.message.indexOf('credentials are invalid') !== -1) this.error = this.i18n('Incorrect username or password.') 70 if (err.message.indexOf('credentials are invalid') !== -1) this.error = this.i18n('Incorrect username or password.')
@@ -74,15 +74,6 @@ export class LoginComponent extends FormReactive implements OnInit {
74 ) 74 )
75 } 75 }
76 76
77 redirect () {
78 const redirect = this.authService.redirectUrl
79 if (redirect) {
80 this.router.navigate([ redirect ])
81 } else {
82 this.redirectService.redirectToHomepage()
83 }
84 }
85
86 askResetPassword () { 77 askResetPassword () {
87 this.userService.askResetPassword(this.forgotPasswordEmail) 78 this.userService.askResetPassword(this.forgotPasswordEmail)
88 .subscribe( 79 .subscribe(