-
Notifications
You must be signed in to change notification settings - Fork 10.7k
[release/8.0] Update @azure/msal-browser from 2.x to 4.x #66236
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -144,6 +144,10 @@ class MsalAuthorizeService implements AuthorizeService { | |
| this._msalApplication = new Msal.PublicClientApplication(this._settings); | ||
| } | ||
|
|
||
| async initialize(): Promise<void> { | ||
| await this._msalApplication.initialize(); | ||
| } | ||
|
|
||
| getAccount() { | ||
| if (this._account) { | ||
| return this._account; | ||
|
|
@@ -283,7 +287,7 @@ class MsalAuthorizeService implements AuthorizeService { | |
| return await this._msalApplication.loginPopup(request); | ||
| } catch (e) { | ||
| // If the user explicitly cancelled the pop-up, avoid performing a redirect. | ||
| if (this.isMsalError(e) && e.errorCode !== Msal.BrowserAuthErrorMessage.userCancelledError.code) { | ||
| if (this.isMsalError(e) && e.errorCode !== Msal.BrowserAuthErrorCodes.userCancelled) { | ||
| this.debug('User canceled sign-in pop-up'); | ||
| this.signInWithRedirect(request); | ||
| } else { | ||
|
|
@@ -466,6 +470,7 @@ export class AuthenticationService { | |
| public static async init(settings: AuthorizeServiceConfiguration, jsLoggingOptions: JavaScriptLoggingOptions) { | ||
| if (!AuthenticationService._initialized) { | ||
| AuthenticationService.instance = new MsalAuthorizeService(settings, new Logger(jsLoggingOptions)); | ||
| await AuthenticationService.instance.initialize(); | ||
| AuthenticationService.instance.initializeMsalHandler(); | ||
| AuthenticationService._initialized = true; | ||
| } | ||
|
Comment on lines
470
to
476
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The debug log message is misleading: this branch executes when the error is not
userCancelled, but it logs "User canceled sign-in pop-up" and the preceding comment says cancellation should avoid redirect. Please adjust the message (and/or branch structure) so logs/comments match the actual redirect fallback behavior.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this seems correct. looking through the history a bit this was refactored a couple times (e.g. ecf2a23#diff-e93d88646a9c7b8accad9fd0d381af964d3f5e6bba9d4e72c22f602565a3c4cc) but the original intention of the comment was to talk about the "else" case
/cc @javiercn