async getToken(code){
const headers = {
"Content-type" : "application/x-www-form-urlencoded;charset=utf-8"
}
const host = `${this.KKO_HOST}/oauth/token`
// const body = this.qs.stringify({
// grant_type:'authorization_code',
// client_id: this.REST_API_KEY,
// redirect_uri: this.REDIRECT_URI,
// code,
// client_secret: this.CLIENT_SERCRET,
// })
const body = {
grant_type:'authorization_code',
client_id: this.REST_API_KEY,
redirect_uri: this.REDIRECT_URI,
code,
client_secret: this.CLIENT_SERCRET,
}
const {data} = await this.axios.post(host, body, headers)
return data
}
AxiosError: Request failed with status code 401
at settle (/Users/mac/Desktop/KGA/ipk_board/back/node_modules/axios/dist/node/axios.cjs:1896:12)
at IncomingMessage.handleStreamEnd (/Users/mac/Desktop/KGA/ipk_board/back/node_modules/axios/dist/node/axios.cjs:2940:11)
at IncomingMessage.emit (node:events:525:35)
at endReadableNT (node:internal/streams/readable:1359:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
현재 인가 코드까지 받아서 req.query로 code를 받은 다음 access_token을 요청할때 나는 오류입니다.
사실 어제까지는 됐었는데 자고 일어나니 안되는데 도저히 못찾겠습니다 ㅠㅠ
잘못된 param을 도저히 못찾겠어서 글써봅니다!