Skip to content

Commit

Permalink
Fixes a login issue proxy related to proxy config
Browse files Browse the repository at this point in the history
  • Loading branch information
gingi committed Aug 1, 2022
1 parent ff8309b commit 4661a6a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/client/core/aad/auth-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ export default class AuthProvider {

private async _createClient(tenantId: string):
Promise<PublicClientApplication> {
const proxySettings = await this.app.proxySettings.settings;
const proxyUrl = proxySettings?.http.toString();
const proxyUrl = await this._loadProxyUrl();

if (proxyUrl) {
log.info(`[${tenantId}] Proxying auth endpoints through ` +
proxyUrl);
Expand All @@ -197,6 +197,12 @@ export default class AuthProvider {
});
}

private async _loadProxyUrl() {
const proxySettings = await this.app.proxySettings.settings;
const protocolUrl = proxySettings?.https ?? proxySettings?.http;
return protocolUrl?.toString();
}

private async _getAccount(tenantId: string): Promise<AccountInfo> {
if (tenantId in this._accounts) {
return this._accounts[tenantId];
Expand Down

0 comments on commit 4661a6a

Please sign in to comment.