Fix refresh token expired handling
authorChocobozzz <florian.bigard@gmail.com>
Wed, 4 Oct 2017 07:30:57 +0000 (09:30 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Wed, 4 Oct 2017 07:30:57 +0000 (09:30 +0200)
client/src/app/core/auth/auth.service.ts

index 522efb23ced707eef55a07bd7df67bac7e1fd2af..4a8814c4e4c5dc6e077952606380fe1f911cd73c 100644 (file)
@@ -170,7 +170,7 @@ export class AuthService {
                     .map(res => this.handleRefreshToken(res))
                     .catch(res => {
                       // The refresh token is invalid?
-                      if (res.status === 400 && res.error === 'invalid_grant') {
+                      if (res.status === 400 && res.error.error === 'invalid_grant') {
                         console.error('Cannot refresh token -> logout...')
                         this.logout()
                         this.router.navigate(['/login'])