Skip to content

Commit

Permalink
Set the SDK header also in the token verifier.
Browse files Browse the repository at this point in the history
  • Loading branch information
wparad committed Oct 11, 2024
1 parent 2ba0a20 commit b0d543e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/tokenVerifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ const { URL } = require('url');
const ServiceClientTokenProvider = require('./serviceClientTokenProvider');
const TokenVerificationError = require('./tokenVerificationError');
const { sanitizeUrl } = require('./util');
const packageInfo = require('../package.json');

const keyMap = {};
const client = axios.create();

// Avoid breaking SDK usages in UIs that depend on this library, since we aren't allowed to set User-Agent in a browser context
if (process && process.versions && process.versions.node) {
client.defaults.headers.common['User-Agent'] = `Authress SDK; Javascript; ${packageInfo.version};`;
}

function decode(token) {
try {
return token && {
Expand Down

0 comments on commit b0d543e

Please sign in to comment.