Skip to content

Commit

Permalink
Remove extraneous data from token requests
Browse files Browse the repository at this point in the history
  • Loading branch information
iaincollins committed Oct 21, 2024
1 parent df36183 commit 22147ef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ const warmCache = require('./lib/warm-cache')
app.use((ctx, next) => {
ctx.set('Ardent-API-Version', `${Package.version}`)

// TODO Conditional cache headers - This implementation seems to be causing
// an issue with the reverse proxy that handles SSL, so I'm leaving it
// disabled for now and may split off auth into a seperate service/hostname.
/*
if (ctx.url.startsWith('/api/auth/') || ctx.url.startsWith('/auth/')) {
console.log('no cache')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ardent-api",
"version": "3.31.0",
"version": "3.32.0",
"description": "Ardent API provides access to data submitted to EDDN",
"main": "index.js",
"scripts": {
Expand Down
3 changes: 1 addition & 2 deletions router/api/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = (router) => {
// Request tokens from fdev
const response = await fetch('https://auth.frontierstore.net/token', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: formData({
'client_id': AUTH_CLIENT_ID,
'redirect_uri': AUTH_CALLBACK_URL,
Expand Down Expand Up @@ -249,7 +249,6 @@ async function refreshJwt(jwtPayload) {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: formData({
'client_id': AUTH_CLIENT_ID,
'redirect_uri': AUTH_CALLBACK_URL,
'grant_type': 'refresh_token',
'refresh_token': jwtPayload.refreshToken
})
Expand Down

0 comments on commit 22147ef

Please sign in to comment.