diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-24 10:40:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-24 10:40:27 +0200 |
commit | 0b4e5fe32708afce54212810738aa4d0c3dc178d (patch) | |
tree | 5d9b160e257a2bd116e67c9363b798f422ead44c /client/src/app/core | |
parent | 23db998f07d674c621972a769df73203b14e093a (diff) | |
parent | 01448622992b12318a2fff508e501732b59dd6be (diff) | |
download | PeerTube-0b4e5fe32708afce54212810738aa4d0c3dc178d.tar.gz PeerTube-0b4e5fe32708afce54212810738aa4d0c3dc178d.tar.zst PeerTube-0b4e5fe32708afce54212810738aa4d0c3dc178d.zip |
Merge branch 'develop' into unused-imports
Diffstat (limited to 'client/src/app/core')
-rw-r--r-- | client/src/app/core/auth/auth.service.ts | 3 | ||||
-rw-r--r-- | client/src/app/core/routing/login-guard.service.ts | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts index 88ea89639..8ff5713a1 100644 --- a/client/src/app/core/auth/auth.service.ts +++ b/client/src/app/core/auth/auth.service.ts | |||
@@ -38,6 +38,7 @@ export class AuthService { | |||
38 | loginChangedSource: Observable<AuthStatus> | 38 | loginChangedSource: Observable<AuthStatus> |
39 | userInformationLoaded = new ReplaySubject<boolean>(1) | 39 | userInformationLoaded = new ReplaySubject<boolean>(1) |
40 | hotkeys: Hotkey[] | 40 | hotkeys: Hotkey[] |
41 | redirectUrl: string | ||
41 | 42 | ||
42 | private clientId: string = peertubeLocalStorage.getItem(AuthService.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_ID) | 43 | private clientId: string = peertubeLocalStorage.getItem(AuthService.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_ID) |
43 | private clientSecret: string = peertubeLocalStorage.getItem(AuthService.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_SECRET) | 44 | private clientSecret: string = peertubeLocalStorage.getItem(AuthService.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_SECRET) |
@@ -177,6 +178,8 @@ export class AuthService { | |||
177 | this.setStatus(AuthStatus.LoggedOut) | 178 | this.setStatus(AuthStatus.LoggedOut) |
178 | 179 | ||
179 | this.hotkeysService.remove(this.hotkeys) | 180 | this.hotkeysService.remove(this.hotkeys) |
181 | |||
182 | this.redirectUrl = null | ||
180 | } | 183 | } |
181 | 184 | ||
182 | refreshAccessToken () { | 185 | refreshAccessToken () { |
diff --git a/client/src/app/core/routing/login-guard.service.ts b/client/src/app/core/routing/login-guard.service.ts index 18bc41ca6..40ff8f505 100644 --- a/client/src/app/core/routing/login-guard.service.ts +++ b/client/src/app/core/routing/login-guard.service.ts | |||
@@ -20,6 +20,8 @@ export class LoginGuard implements CanActivate, CanActivateChild { | |||
20 | canActivate (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { | 20 | canActivate (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { |
21 | if (this.auth.isLoggedIn() === true) return true | 21 | if (this.auth.isLoggedIn() === true) return true |
22 | 22 | ||
23 | this.auth.redirectUrl = state.url | ||
24 | |||
23 | this.router.navigate([ '/login' ]) | 25 | this.router.navigate([ '/login' ]) |
24 | return false | 26 | return false |
25 | } | 27 | } |