diff --git a/src/components/repo/authv2.ts b/src/components/repo/authv2.ts index ab17fc3..a50d059 100644 --- a/src/components/repo/authv2.ts +++ b/src/components/repo/authv2.ts @@ -155,7 +155,7 @@ export class AuthV2Repo { } async request(url: string, params: RequestInit = {}) { - if (this.accessToken !== undefined && this.accessTokenExpires !== undefined && this.accessTokenExpires.isBefore(dayjs())) { + if (this.accessToken !== undefined && this.accessTokenExpires !== undefined && this.accessTokenExpires.isBefore(dayjs().add(10, "seconds"))) { await this.refresh(); } diff --git a/src/components/repo/stats.ts b/src/components/repo/stats.ts index 52ef4e1..8265f0a 100644 --- a/src/components/repo/stats.ts +++ b/src/components/repo/stats.ts @@ -36,7 +36,7 @@ export class StatsRepo { } public async getUserStats(id: string): Promise { - return await fetchWithToken(this.token, `/stats/user/${id}`).then(value => value.json()).then(UserStatsSchema.parse); + return await fetchWithToken(this.token, `/stats/user`).then(value => value.json()).then(UserStatsSchema.parse); } }