mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-18 06:09:58 +00:00
reddit: fix expiry check
This commit is contained in:
parent
60743cdcdf
commit
c26800ca2e
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