diff --git a/client/state/Token.ts b/client/state/Token.ts index a463a0c..67fdc48 100644 --- a/client/state/Token.ts +++ b/client/state/Token.ts @@ -1,4 +1,4 @@ -import TokenClaims from "@common/TokenClaims"; +import { TokenClaims } from "@common/TokenClaims"; import * as jwt from "jsonwebtoken"; import { computed, createAtom, IAtom, observable } from "mobx"; @@ -38,7 +38,7 @@ export class Token { if (!this.isExpiredAtom.reportObserved()) { this.updateCurrentTime(false); } - if (this.claims == null) { + if (this.claims == null || this.claims.exp == null) { return Number.NEGATIVE_INFINITY; } return this.claims.exp - this.currentTime;