From 263fbc377eb6444d97f21642fe5be41e30f0a3e4 Mon Sep 17 00:00:00 2001 From: Manti <67705577+mantikafasi@users.noreply.github.com> Date: Sat, 3 Jun 2023 23:07:04 +0300 Subject: Fix ReviewDB auth (#1227) --- src/plugins/reviewDB/index.tsx | 4 ++-- src/plugins/reviewDB/utils.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/plugins/reviewDB/index.tsx b/src/plugins/reviewDB/index.tsx index 0dcb7cd..de09ac7 100644 --- a/src/plugins/reviewDB/index.tsx +++ b/src/plugins/reviewDB/index.tsx @@ -79,8 +79,8 @@ export default definePlugin({ addContextMenuPatch("guild-header-popout", guildPopoutPatch); if (user.banInfo) { - const endDate = new Date(user.banInfo.banEndDate).getTime(); - if (endDate > Date.now() && (s.user?.banInfo?.banEndDate ?? 0) < endDate) { + const endDate = new Date(user.banInfo.banEndDate); + if (endDate.getTime() > Date.now() && (s.user?.banInfo?.banEndDate ?? 0) < endDate.getTime()) { Alerts.show({ title: "You have been banned from ReviewDB", body: ( diff --git a/src/plugins/reviewDB/utils.tsx b/src/plugins/reviewDB/utils.tsx index 67d043d..da800b0 100644 --- a/src/plugins/reviewDB/utils.tsx +++ b/src/plugins/reviewDB/utils.tsx @@ -50,9 +50,9 @@ export function authorize(callback?: any) { permissions={0n} clientId="915703782174752809" cancelCompletesFlow={false} - callback={async (u: string) => { + callback={async (response: any) => { try { - const url = new URL(u); + const url = new URL(response.location); url.searchParams.append("clientMod", "vencord"); const res = await fetch(url, { headers: new Headers({ Accept: "application/json" }) -- cgit