async
This commit is contained in:
Родитель
e02d88bb11
Коммит
0b43baed4e
|
@ -1,3 +1,4 @@
|
|||
# Local Netlify folder
|
||||
.netlify
|
||||
.env
|
||||
.env
|
||||
node_modules
|
|
@ -9,13 +9,13 @@ 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 = "default";
|
||||
let response_message = await request(auth_url);
|
||||
|
||||
response_message = await request(auth_url);
|
||||
const access_token = response_message.response.access_token
|
||||
|
||||
return {
|
||||
statusCode: 200,
|
||||
body: JSON.stringify({ message: `${JSON.stringify(response_message)}` }),
|
||||
body: JSON.stringify({ message: `${JSON.stringify(access_token)}` }),
|
||||
};
|
||||
} catch (err) {
|
||||
return { statusCode: 500, body: err.toString() };
|
||||
|
|
Загрузка…
Ссылка в новой задаче