From 311a95ed9738b3639abf790e95ec1371a64a1343 Mon Sep 17 00:00:00 2001 From: Untone Date: Mon, 4 Mar 2024 19:12:23 +0300 Subject: [PATCH] token-check-fix --- index.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; }