Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Norling <thomas.norling@microsoft.com>
  • Loading branch information
jo-arroyo and tnorling committed Aug 2, 2024
1 parent 026e353 commit 1235033
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 0 additions & 2 deletions lib/msal-browser/src/config/Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ export type BrowserAuthOptions = {
supportsNestedAppAuth?: boolean;
/**
* Callback that will be passed the url that MSAL will navigate to in redirect flows. Returning false in the callback will stop navigation.
*
* This configuration option will replace onRedirectNavigate in the RedirectRequest object in the next major version.
*/
onRedirectNavigate?: (url: string) => boolean | void;
};
Expand Down
2 changes: 1 addition & 1 deletion lib/msal-browser/src/error/BrowserAuthError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const BrowserAuthErrorMessages = {
[BrowserAuthErrorCodes.invalidPopTokenRequest]:
"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",
[BrowserAuthErrorCodes.noAutoRetry]:
"Unable to auto retry due to onRedirectNavigate not set in MSAL configuration. Please set onRedirectNavigate and manually retry with correlationId returned.",
"Unable to retry failed auth code redemption due to usage of the onRedirectNavigate request parameter. Please set onRedirectNavigate on the PublicClientApplication configuration instead or call loginRedirect again.",
};

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/msal-browser/src/error/BrowserAuthErrorCodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ export const uninitializedPublicClientApplication =
export const nativePromptNotSupported = "native_prompt_not_supported";
export const invalidBase64String = "invalid_base64_string";
export const invalidPopTokenRequest = "invalid_pop_token_request";
export const noAutoRetry = "no_auto_retry_error";
export const failedToRetry = "failed_to_retry";
5 changes: 2 additions & 3 deletions lib/msal-browser/src/interaction_client/RedirectClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,9 @@ export class RedirectClient extends StandardInteractionClient {
throw e;
}

const onRedirectNavigate = this.config.auth.onRedirectNavigate;
if (!onRedirectNavigate) {
if (request.onRedirectNavigate) {
this.logger.error(
`Unable to retry redirect request without onRedirectNavigate. Please retry with redirect request and correlationId: ${this.correlationId}`
`Unable to retry redirect request due to presence of onRedirectNavigate request parameter. Please retry with redirect request and correlationId: ${this.correlationId}`
);
this.browserStorage.setRequestRetried(this.correlationId);
throw createBrowserAuthError(
Expand Down

0 comments on commit 1235033

Please sign in to comment.