mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-12 20:25:06 +01:00
reddit: fix expiry check
merge pull request #247 from dumbmoron/fix-reddit-expiry
This commit is contained in:
commit
561c9f1dfd
1 changed files with 1 additions and 1 deletions
|
@ -18,7 +18,7 @@ async function getAccessToken() {
|
||||||
const values = cookie.values(),
|
const values = cookie.values(),
|
||||||
needRefresh = !values.access_token
|
needRefresh = !values.access_token
|
||||||
|| !values.expiry
|
|| !values.expiry
|
||||||
|| Number(values.expiry) > new Date().getTime();
|
|| Number(values.expiry) < new Date().getTime();
|
||||||
if (!needRefresh) return values.access_token;
|
if (!needRefresh) return values.access_token;
|
||||||
|
|
||||||
const data = await fetch('https://www.reddit.com/api/v1/access_token', {
|
const data = await fetch('https://www.reddit.com/api/v1/access_token', {
|
||||||
|
|
Loading…
Reference in a new issue