Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force an update after acquiring a token interactively #239535

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Feb 3, 2025

This will make sure the account cache is up-to-date before the acquireTokenInteractive ends.

A greater fix is maybe turning the accounts cache to be a promise.. but I won't do that for a candidate.

Fixes #235327

This will make sure the account cache is up-to-date before the `acquireTokenInteractive` ends.

Fixes #235327
@TylerLeonhardt TylerLeonhardt self-assigned this Feb 3, 2025
@@ -233,7 +233,6 @@ export class MsalAuthProvider implements AuthenticationProvider {
const session = this.sessionFromAuthenticationResult(result, scopeData.originalScopes);
this._telemetryReporter.sendLoginEvent(session.scopes);
this._logger.info('[createSession]', `[${scopeData.scopeStr}]`, 'returned session');
this._onDidChangeSessionsEmitter.fire({ added: [session], changed: [], removed: [] });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant since the update() in the other file change will trigger this event.

Comment on lines +163 to +168
);
if (this._isBrokerAvailable) {
await this._accountAccess.setAllowedAccess(result.account!, true);
}
// Force an update so that the account cache is updated
await this._update();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This moves this stuff into the sequencer & adds a this._update() to force an update.

@connor4312 connor4312 added the candidate Issue identified as probable candidate for fixing in the next release label Feb 3, 2025
@TylerLeonhardt TylerLeonhardt merged commit a4815c3 into release/1.97 Feb 3, 2025
8 checks passed
@TylerLeonhardt TylerLeonhardt deleted the tyler/tender-viper branch February 3, 2025 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
candidate Issue identified as probable candidate for fixing in the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants