Fixed date compare of gr-gapi-auth

Date.now() returns a number and new Date returns a date object.
Calling .getTime() returns the date in an integer format.

Change-Id: I26fe2c8eb5ab314dd215191f282aaf46e56caa46
This commit is contained in:
Thomas Shafer
2017-07-21 13:44:35 -07:00
parent b267eb5819
commit cda010a5bd

View File

@@ -95,7 +95,7 @@
if (!token.access_token || !token.expires_at) { return false; }
const expiration = new Date(parseInt(token.expires_at, 10) * 1000);
if (Date.now() >= expiration) { return false; }
if (Date.now() >= expiration.getTime()) { return false; }
return true;
};