only allow list of ids

This commit is contained in:
evanpelle
2025-07-12 11:56:55 -07:00
parent 76fb54a81e
commit 191184eca3
2 changed files with 95 additions and 0 deletions
+7
View File
@@ -1,6 +1,7 @@
import { decodeJwt } from "jose";
import { z } from "zod/v4";
import {
allowedDiscordIds,
RefreshResponseSchema,
TokenPayload,
TokenPayloadSchema,
@@ -233,6 +234,12 @@ export async function getUserMe(): Promise<UserMeResponse | false> {
console.error("Invalid response", error);
return false;
}
if (!allowedDiscordIds.includes(result.data.user.id)) {
console.error("Unauthorized: User not in allowed list");
clearToken();
window.location.href = "https://www.youtube.com/watch?v=dQw4w9WgXcQ";
return false;
}
return result.data;
} catch (e) {
__isLoggedIn = false;
+88
View File
@@ -47,3 +47,91 @@ export const UserMeResponseSchema = z.object({
}),
});
export type UserMeResponse = z.infer<typeof UserMeResponseSchema>;
export const allowedDiscordIds: string[] = [
"801201988980834374",
"383908937407135744",
"991040538142715914",
"109208187495796736",
"524916260480221184",
"923944328945098792",
"1248130385230037125",
"1042867662692302878",
"1231353285798002711",
"1380825798956548217",
"321330861305757696",
"1231132235793694762",
"518092307765919755",
"818164543477645324",
"1056637784556843009",
"748290919886749828",
"1207048759616217101",
"1332571420701757441",
"402217202113052682",
"207467536432889857",
"1068599025932193904",
"1068599025932193904",
"717364086874046584",
"470638985870442516",
"257866880402849792",
"863823197035823125",
"662278693179097088",
"1371692527702380616",
"296454138877968385",
"337118939421212673",
"719142768693346315",
"537013169546067974",
"1237133105215574056",
"1149773842877796423",
"229985855077351424",
"536446199012655104",
"302797599952470016",
"269534621719330816",
"1125081721507958904",
"735445052461023302",
"515926547786629142",
"1388899072034738176",
"1260964720824025088",
"1042598121429028944",
"1086680982712758312",
"439390916676026378",
"1233539002171392052",
"748439392489701396",
"1134460734923882506",
"1120408570668789941",
"969552442704412672",
"928360146583842896",
"376153617306091533",
"420169470942904320",
"642727461171232794",
"1136031095515783229",
"207082417217994754",
"377107679975309313",
"250918787178561537",
"792380506939457536",
"239571828325089280",
"307514132846870546",
"162984858811891715",
"928735342469726298",
"516828441065160714",
"1334886860538904679",
"1060632477489713212",
"658879672851103755",
"1035677402606600252",
"874951032319397918",
"384767022560575496",
"814085898932715560",
"327950020831870987",
"292684898324709377",
"905159200462753874",
"1165558245096706129",
"1088886751810027600",
"943482851628826635",
"640771103425429525",
"1313943792948350976",
"1054834071789908019",
"277841234133778432",
"260802472421883906",
"230415855614296075",
"251738465643921409",
];