Fix ReviewDB auth (#1227)
This commit is contained in:
parent
c9c0ab5aca
commit
263fbc377e
|
@ -79,8 +79,8 @@ export default definePlugin({
|
||||||
addContextMenuPatch("guild-header-popout", guildPopoutPatch);
|
addContextMenuPatch("guild-header-popout", guildPopoutPatch);
|
||||||
|
|
||||||
if (user.banInfo) {
|
if (user.banInfo) {
|
||||||
const endDate = new Date(user.banInfo.banEndDate).getTime();
|
const endDate = new Date(user.banInfo.banEndDate);
|
||||||
if (endDate > Date.now() && (s.user?.banInfo?.banEndDate ?? 0) < endDate) {
|
if (endDate.getTime() > Date.now() && (s.user?.banInfo?.banEndDate ?? 0) < endDate.getTime()) {
|
||||||
Alerts.show({
|
Alerts.show({
|
||||||
title: "You have been banned from ReviewDB",
|
title: "You have been banned from ReviewDB",
|
||||||
body: (
|
body: (
|
||||||
|
|
|
@ -50,9 +50,9 @@ export function authorize(callback?: any) {
|
||||||
permissions={0n}
|
permissions={0n}
|
||||||
clientId="915703782174752809"
|
clientId="915703782174752809"
|
||||||
cancelCompletesFlow={false}
|
cancelCompletesFlow={false}
|
||||||
callback={async (u: string) => {
|
callback={async (response: any) => {
|
||||||
try {
|
try {
|
||||||
const url = new URL(u);
|
const url = new URL(response.location);
|
||||||
url.searchParams.append("clientMod", "vencord");
|
url.searchParams.append("clientMod", "vencord");
|
||||||
const res = await fetch(url, {
|
const res = await fetch(url, {
|
||||||
headers: new Headers({ Accept: "application/json" })
|
headers: new Headers({ Accept: "application/json" })
|
||||||
|
|
Loading…
Reference in a new issue