feat(auth): add psid field to various login request DTOs and schemas

This commit is contained in:
2026-07-10 16:33:29 +08:00
parent 4e06e08b15
commit dfcb06f5a9
13 changed files with 45 additions and 8 deletions
@@ -1,7 +1,5 @@
#!/usr/bin/env node
const crypto = require("node:crypto");
const GRAPH_API_VERSION = "v25.0";
const PSID = "27511427698460020";
const EXPECTED_ASID = "122111097783118257";
@@ -15,9 +13,9 @@ function assertConfigured(name, value) {
}
}
function createAppSecretProof(accessToken, appSecret) {
return crypto
.createHmac("sha256", appSecret.trim())
async function createAppSecretProof(accessToken, appSecret) {
const { createHmac } = await import("node:crypto");
return createHmac("sha256", appSecret.trim())
.update(accessToken.trim())
.digest("hex");
}
@@ -33,7 +31,7 @@ async function main() {
url.searchParams.set("access_token", PAGE_ACCESS_TOKEN);
url.searchParams.set(
"appsecret_proof",
createAppSecretProof(PAGE_ACCESS_TOKEN, APP_SECRET),
await createAppSecretProof(PAGE_ACCESS_TOKEN, APP_SECRET),
);
const response = await fetch(url);