This commit is contained in:
2026-02-02 12:02:43 +01:00
parent a4d65313f2
commit ab3ca1839f
2 changed files with 53 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
import decrypt from "@moduletrace/datasquirel/dist/package-shared/functions/dsql/decrypt";
const AuthServerPort = 3177;
type AdminPagesAuth = {
date: number;
user_id: number;
url?: string;
};
const server = Bun.serve({
port: AuthServerPort,
fetch(req) {
try {
const url = new URL(req.url);
const key = url.searchParams.get("key");
const srcOrigin = req.headers.get("x-original-uri");
const decryptedKey = JSON.parse(
decrypt({ encryptedString: key! }),
) as AdminPagesAuth;
return new Response("Auth Success!", {
status: 200,
});
} catch (error) {
return new Response("Auth Failed!", {
status: 401,
});
}
},
});
console.log(`Auth Server running at http://localhost:${server.port}/`);