Implementation for the Data Deletion Callback in JavaScript for Node with Expressjs.
The most stupid pitfall for this callback is that the response has to look like this:
{ url: '<url>', confirmation_code: '<code>' }
This and other more reasonable variations are invalid:
{ "url": "<url>", "confirmation_code": "<code>" }
This means you cannot use JSON.stringify
or Response.json(object)
, but this glorious snippet:
res.type('json')
res.send(`{ url: '${url}', confirmation_code: '${confirmationCode}' }`)
Another pitfall is that Facebook's signature always has a =
appended (see line 43 in parseSignedRequest.mjs).
Can you please clarify what this the scope of this function?
function getSignedRequest (req) { return getOrThrowClientError(req, 'body', 'signed_request') }