diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-12-08 17:31:21 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-12-08 17:31:21 +0100 |
commit | f595d3947708114deeed4312cc5ffd285745b090 (patch) | |
tree | e2fef8fae4e9d9ee6039ea2ab53eb20d11002969 /client/src/app/core | |
parent | e600e1fea275c12f4420e23624804617e61a082c (diff) | |
download | PeerTube-f595d3947708114deeed4312cc5ffd285745b090.tar.gz PeerTube-f595d3947708114deeed4312cc5ffd285745b090.tar.zst PeerTube-f595d3947708114deeed4312cc5ffd285745b090.zip |
Finish admin design
Diffstat (limited to 'client/src/app/core')
-rw-r--r-- | client/src/app/core/auth/auth.service.ts | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts index 0db197f02..e887dde1f 100644 --- a/client/src/app/core/auth/auth.service.ts +++ b/client/src/app/core/auth/auth.service.ts | |||
@@ -169,19 +169,15 @@ export class AuthService { | |||
169 | 169 | ||
170 | return this.http.post<UserRefreshToken>(AuthService.BASE_TOKEN_URL, body, { headers }) | 170 | return this.http.post<UserRefreshToken>(AuthService.BASE_TOKEN_URL, body, { headers }) |
171 | .map(res => this.handleRefreshToken(res)) | 171 | .map(res => this.handleRefreshToken(res)) |
172 | .catch(res => { | 172 | .catch(err => { |
173 | // The refresh token is invalid? | 173 | console.error(err) |
174 | if (res.status === 400 && res.error.error === 'invalid_grant') { | 174 | console.log('Cannot refresh token -> logout...') |
175 | console.error('Cannot refresh token -> logout...') | 175 | this.logout() |
176 | this.logout() | 176 | this.router.navigate(['/login']) |
177 | this.router.navigate(['/login']) | 177 | |
178 | 178 | return Observable.throw({ | |
179 | return Observable.throw({ | 179 | error: 'You need to reconnect.' |
180 | error: 'You need to reconnect.' | 180 | }) |
181 | }) | ||
182 | } | ||
183 | |||
184 | return this.restExtractor.handleError(res) | ||
185 | }) | 181 | }) |
186 | } | 182 | } |
187 | 183 | ||