mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 10:19:51 -06:00
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com>
24 lines
1.1 KiB
Diff
24 lines
1.1 KiB
Diff
diff --git a/core/lib/oauth/client.js b/core/lib/oauth/client.js
|
|
index 52c51eb6ff422dc0899ccec31baf3fa39e42eeae..d33754cb23f5fb949b367b4ed159e53cb12723fa 100644
|
|
--- a/core/lib/oauth/client.js
|
|
+++ b/core/lib/oauth/client.js
|
|
@@ -5,9 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
});
|
|
exports.openidClient = openidClient;
|
|
var _openidClient = require("openid-client");
|
|
+var httpProxyAgent = require("https-proxy-agent");
|
|
async function openidClient(options) {
|
|
const provider = options.provider;
|
|
- if (provider.httpOptions) _openidClient.custom.setHttpOptionsDefaults(provider.httpOptions);
|
|
+ let httpOptions = {};
|
|
+ if (provider.httpOptions) httpOptions = { ...provider.httpOptions };
|
|
+ const proxyUrl = process.env.HTTPS_PROXY || process.env.HTTP_PROXY || process.env.https_proxy || process.env.http_proxy;
|
|
+ if(proxyUrl) {
|
|
+ const agent = new httpProxyAgent.HttpsProxyAgent(proxyUrl);
|
|
+ httpOptions.agent = agent;
|
|
+ }
|
|
+ _openidClient.custom.setHttpOptionsDefaults(httpOptions);
|
|
let issuer;
|
|
if (provider.wellKnown) {
|
|
issuer = await _openidClient.Issuer.discover(provider.wellKnown);
|