Permalink
Browse files

fix(isAuthenticated): always check access_token existence

  • Loading branch information...
doktordirk committed Oct 11, 2016
1 parent e083ecb commit 72fb3777a75026b970a33012788b6e88eaa5abd5
Showing with 3 additions and 7 deletions.
  1. +2 −2 src/authService.js
  2. +1 −5 src/authentication.js
@@ -137,7 +137,7 @@ export class AuthService {
if (this.config.autoUpdateToken
&& this.authentication.getAccessToken()
&& this.authentication.getRefreshToken()) {
this.updateToken();
this.updateToken().catch(_ => _);
return;
}
@@ -276,7 +276,7 @@ export class AuthService {
&& this.authentication.getAccessToken()
&& this.authentication.getRefreshToken()
) {
this.updateToken();
this.updateToken().catch(_ => _);
authenticated = true;
}
@@ -143,11 +143,7 @@ export class Authentication {
}
isAuthenticated(): boolean {
const isTokenExpired = this.isTokenExpired();
if (isTokenExpired === undefined) return !!this.accessToken;
return !isTokenExpired;
return !!this.accessToken && !this.isTokenExpired();
}
/* get and set from response */

0 comments on commit 72fb377

Please sign in to comment.