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:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user