Updates
This commit is contained in:
@@ -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}/`);
|
||||
Reference in New Issue
Block a user