Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit c7605b3

Browse files
committed
accept json on get access token
1 parent b9ccdc7 commit c7605b3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

api/src/controllers/github.controller.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import axios from 'axios';
22
import { GITHUB_ACCESS_TOKEN_URL, GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, GITHUB_USER_API } from '../config.js';
33

44
export const getAccessToken = async (req, res) => {
5-
await axios.post(`${GITHUB_ACCESS_TOKEN_URL}?client_id=${GITHUB_CLIENT_ID}&client_secret=${GITHUB_CLIENT_SECRET}&code=${req.query.code}`).then((response) => {
5+
await axios.post(`${GITHUB_ACCESS_TOKEN_URL}?client_id=${GITHUB_CLIENT_ID}&client_secret=${GITHUB_CLIENT_SECRET}&code=${req.query.code}`, {headers: {
6+
"Accept": "application/json"
7+
}}).then((response) => {
68
return response.json()
79
}).then((data) => {
810
res.json(data);

0 commit comments

Comments
 (0)