diff --git a/index.mjs b/index.mjs index 83cb788..01fa815 100644 --- a/index.mjs +++ b/index.mjs @@ -25,12 +25,14 @@ const server = Server.configure({ const shout_id = parseInt(data.documentName.replace('shout-', ''), 10) console.debug(`shout_id extracted: ${shout_id}`); + const token = data.token || data.requestHeaders['authorization'] || '' + const params = { token_type: 'access_token', - token: data.requestHeaders['authorization'] || '', + token }; - if (!params.token) { + if (!token) { console.error('Authorization token not found'); return null; }