diff --git a/functions/untappd_callback/untappd_callback.js b/functions/untappd_callback/untappd_callback.js index 3582cd0..8045f2f 100644 --- a/functions/untappd_callback/untappd_callback.js +++ b/functions/untappd_callback/untappd_callback.js @@ -2,12 +2,21 @@ exports.handler = async (event, context) => { try { const code = event.queryStringParameters.code || 'World' + const client_id = process.env.UNTAPPD_CLIENT_ID + const client_secret = process.env.UNTAPPD_CLIENT_SECRET + 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` + return { statusCode: 200, - body: JSON.stringify({ message: `${code}` }) + body: JSON.stringify({ message: `${auth_url}` }) // // more keys you can return: // headers: { "headerName": "headerValue", ... }, // isBase64Encoded: true, + + // https://untappd.com/oauth/authorize/?client_id=CLIENTID&client_secret=CLIENTSECRET&response_type=code&redirect_url=REDIRECT_URL&code=CODE + + } } catch (err) { return { statusCode: 500, body: err.toString() }