Update azure/msal-browser#66055
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Blazor WebAssembly MSAL interop package to use the supported @azure/msal-browser 4.x line, including the minimal code changes needed to align with msal-browser’s newer initialization and error-code APIs.
Changes:
- Bump
@azure/msal-browserfrom 2.x to^4.30.0. - Add an explicit MSAL application initialization step (
PublicClientApplication.initialize()), awaited during interop init. - Update the user-cancelled popup error-code check to the v4 API (
BrowserAuthErrorCodes.userCancelled).
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Components/WebAssembly/Authentication.Msal/src/Interop/package.json | Updates the MSAL browser dependency range to 4.x. |
| src/Components/WebAssembly/Authentication.Msal/src/Interop/AuthenticationService.ts | Adds MSAL initialization and updates error-code usage for v4. |
| package-lock.json | Refreshes lockfile entries for @azure/msal-browser/@azure/msal-common to match the new version. |
| // 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); |
There was a problem hiding this comment.
The condition here triggers the redirect fallback when the error is not userCancelled, but the log message says the user canceled. This is misleading for diagnostics; consider updating the message to reflect a non-cancel popup failure (e.g., popup blocked) that is causing the redirect fallback.
|
/backport to release/10.0 |
|
Started backporting to |
|
/backport to release/9.0 |
|
Started backporting to |
The 2.x versions of this package are EOL & flagged by CG. Updating to 4.x