Browse Source

Fixed token type issues

update-deps
Alex Mikhalev 7 years ago
parent
commit
6b1b650f78
  1. 4
      client/state/Token.ts

4
client/state/Token.ts

@ -1,4 +1,4 @@ @@ -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 { @@ -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;

Loading…
Cancel
Save