reddit: fix expiry check

merge pull request #247 from dumbmoron/fix-reddit-expiry
This commit is contained in:
wukko 2023-11-23 21:29:46 +06:00 committed by GitHub
commit 561c9f1dfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,7 @@ async function getAccessToken() {
const values = cookie.values(),
needRefresh = !values.access_token
|| !values.expiry
|| Number(values.expiry) > new Date().getTime();
|| Number(values.expiry) < new Date().getTime();
if (!needRefresh) return values.access_token;
const data = await fetch('https://www.reddit.com/api/v1/access_token', {