Skip to content

Commit 2423e88

Browse files
authored
Merge pull request #2552 from Azure/hotfix/proxy-config-login-error
Fixes a login issue related to proxy config
2 parents 507127f + 43565df commit 2423e88

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 2.14.2
2+
3+
### Bugs
4+
5+
* Fixes login failures when proxy is misconfigured [\#2551]
6+
17
# 2.14.1
28

39
### Bugs

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"name": "Microsoft Corporation",
1717
"email": "[email protected]"
1818
},
19-
"version": "2.14.1",
19+
"version": "2.14.2",
2020
"main": "build/client/main.prod.js",
2121
"scripts": {
2222
"ts": "ts-node --project tsconfig.node.json --files",

src/client/core/aad/auth-provider.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ export default class AuthProvider {
172172

173173
private async _createClient(tenantId: string):
174174
Promise<PublicClientApplication> {
175-
const proxySettings = await this.app.proxySettings.settings;
176-
const proxyUrl = proxySettings?.http.toString();
175+
const proxyUrl = await this._loadProxyUrl();
176+
177177
if (proxyUrl) {
178178
log.info(`[${tenantId}] Proxying auth endpoints through ` +
179179
proxyUrl);
@@ -197,6 +197,12 @@ export default class AuthProvider {
197197
});
198198
}
199199

200+
private async _loadProxyUrl() {
201+
const proxySettings = await this.app.proxySettings.settings;
202+
const protocolUrl = proxySettings?.https ?? proxySettings?.http;
203+
return protocolUrl?.toString();
204+
}
205+
200206
private async _getAccount(tenantId: string): Promise<AccountInfo> {
201207
if (tenantId in this._accounts) {
202208
return this._accounts[tenantId];

0 commit comments

Comments
 (0)