feat(auth): add psid field to various login request DTOs and schemas
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user