Fix http token interceptor
authorChocobozzz <me@florianbigard.com>
Thu, 11 Jan 2018 14:39:41 +0000 (15:39 +0100)
committerChocobozzz <me@florianbigard.com>
Thu, 11 Jan 2018 14:39:41 +0000 (15:39 +0100)
client/src/app/shared/auth/auth-interceptor.service.ts

index 1e890d8f3846cba5003b871d62dda1f8da3c3dae..efcfc452b654d9ac6ebb91f94deb0d32124a82c5 100644 (file)
@@ -28,7 +28,7 @@ export class AuthInterceptor implements HttpInterceptor {
     // Catch 401 errors (refresh token expired)
     return next.handle(authReq)
                .catch(err => {
-                 if (err.status === 401) {
+                 if (err.status === 401 && err.error && err.error.code === 'invalid_token') {
                    return this.handleTokenExpired(req, next)
                  }