Changed the way that Notion code is sended to this API

This commit is contained in:
2022-04-25 15:32:40 -03:00
parent 094442c1a9
commit 800634bb11
2 changed files with 6 additions and 1 deletions

View File

@@ -23,6 +23,9 @@ app.use(function (req, res, next) {
next();
});
//Enable body json
app.use(Express.json())
//Configure Handlebars
const hbs = require('hbs')
hbs.registerPartials(__dirname + '/../views/partials')

View File

@@ -5,10 +5,12 @@ const axios = require('axios')
router.post('/', async (req, res) => {
console.log(req.body)
async function requestAccessToken() {
try {
const reqData = {
code: req.headers.code,
code: req.body.code,
grant_type: "authorization_code",
redirect_uri: "https://telegram-to-notion.herokuapp.com/auth"
}