From 6b1b650f78c05cbf9cbbe88caa6f05efd121805e Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Sat, 11 Aug 2018 20:02:16 +0300 Subject: [PATCH] Fixed token type issues --- client/state/Token.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;