This commit is contained in:
Wade Wegner 2020-05-03 17:46:36 -07:00
Родитель 0fe52ecc28
Коммит 0de3a27a6c
2 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -0,0 +1 @@
{"message":"{"statusCode":200,"headers":{"date":"Mon, 04 May 2020 00:31:05 GMT","content-type":"application/json","transfer-encoding":"chunked","connection":"close","set-cookie":["__cfduid=dfbef00d049fb515225315f684cc355ce1588552265; expires=Wed, 03-Jun-20 00:31:05 GMT; path=/; domain=.untappd.com; HttpOnly; SameSite=Lax"],"cf-cache-status":"DYNAMIC","expect-ct":"max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"","server":"cloudflare","cf-ray":"58de1de8cf670983-IAD","cf-request-id":"027eb1057a0000098330867200000001"},"body":"{"meta":{"http_code":200},"response":{"access_token":"DFC11DF925CA3630423928CDCCBBE6583E2183A2"}}"}"}

Просмотреть файл

@ -9,11 +9,11 @@ exports.handler = async (event, context) => {
const redirect_url = process.env.UNTAPPD_REDIRECT_URL;
const auth_url = `https://untappd.com/oauth/authorize/?client_id=${client_id}&client_secret=${client_secret}&response_type=code&redirect_url=${redirect_url}&code=${code}`;
let response_message = await request(auth_url).message.body.response.access_token;
let response_message = await request(auth_url).message;
return {
statusCode: 200,
body: JSON.stringify({ message: `${JSON.stringify(response_message)}` }),
body: JSON.stringify({ message: `${JSON.parse(JSON.stringify(response_message))}` }),
};
} catch (err) {
return { statusCode: 500, body: err.toString() };