Skip to content

Commit

Permalink
Fix email comparisons to be case insensitive (#25330)
Browse files Browse the repository at this point in the history
  • Loading branch information
cheenamalhotra authored Feb 16, 2024
1 parent 8a715ed commit 2452651
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ export class AccountManagementService implements IAccountManagementService {
let indexToRemove: number = accounts.findIndex(account => {
// corner case handling for personal accounts
if (account.key.accountId.includes('#') || accountToFind.key.accountId.includes('#')) {
return account.displayInfo.email === accountToFind.displayInfo.email;
return account.displayInfo.email.toLocaleLowerCase() === accountToFind.displayInfo.email.toLocaleLowerCase();
}
// MSAL account added
if (accountToFind.key.accountId.includes('.')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
const azureAccounts = accounts.filter(a => a.key.providerId.startsWith('azure'));
if (azureAccounts && azureAccounts.length > 0) {
let accountId = (connection.authenticationType === Constants.AuthenticationType.AzureMFA || connection.authenticationType === Constants.AuthenticationType.AzureMFAAndUser) ? connection.azureAccount ?? connection.userName : connection.userName;
let account = azureAccounts.find(account => account.key.accountId === accountId || account.displayInfo.email === accountId);
let account = azureAccounts.find(account => account.key.accountId === accountId || account.displayInfo.email.toLocaleLowerCase() === accountId.toLocaleLowerCase());
if (account) {
this._logService.debug(`Getting security token for Azure account ${account.key.accountId}`);
if (account.isStale) {
Expand Down

0 comments on commit 2452651

Please sign in to comment.