Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
throw new Error("The issuer doesn't support session management.");
}
}
let httpOptions = config.httpOptions || {};
httpOptions.headers = Object.assign(
// Allow configuration to override user agent header.
{'User-Agent': `${pkg.name}/${pkg.version}`},
httpOptions.headers || {},
// Do not allow overriding telemetry.
{'Auth0-Client': Buffer.from(JSON.stringify(telemetryHeader)).toString('base64')}
);
custom.setHttpOptionsDefaults(httpOptions);
client[custom.clock_tolerance] = config.clockTolerance;
return client;
}
redirect_uris: [settings.redirectUri],
response_types: ['code']
});
if (clientSettings.httpTimeout) {
const timeout = clientSettings.httpTimeout;
client[custom.http_options] = function setHttpOptions(options: ClientSettings): ClientSettings {
return {
...options,
timeout
};
};
}
if (clientSettings.clockTolerance) {
client[custom.clock_tolerance] = clientSettings.clockTolerance / 1000;
}
return client;
};
}
return pRetry(async () => {
const issuer = await discoverIssuer(url)
overrideHttpOptions.call(issuer)
const client = new issuer.Client({
client_id: clientId,
client_secret: clientSecret
})
overrideHttpOptions.call(client)
client[custom.clock_tolerance] = clockTolerance
return client
}, {
forever: true,