Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
refresh token if cookie is enabled but missing
  • Loading branch information
louiszuckerman committed Jul 28, 2017
1 parent 4968f78 commit 5186a61
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/service/ngJwtAuthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,15 @@ export class NgJwtAuthService {
;

//needs to refresh if the the next time we could refresh is after the configured refresh before date
return (latestRefresh <= nextRefreshOpportunity);
return (latestRefresh <= nextRefreshOpportunity || this.cookieIsMissing());
}

/**
* Check if there should be a cookie, but it is missing
* @returns {boolean}
*/
private cookieIsMissing():boolean {
return this.config.cookie.enabled && !this.$cookies.get(this.config.cookie.name);
}

/**
Expand Down

0 comments on commit 5186a61

Please sign in to comment.