Skip to content

Commit

Permalink
more MSAL errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sadasant authored Apr 6, 2021
1 parent 5b01a8d commit d67b645
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions sdk/identity/identity/src/msal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ export class MsalBaseUtilities {
* Handles MSAL errors.
*/
protected handleError(scopes: string[], error: Error, getTokenOptions?: GetTokenOptions): Error {
if (error.name === "AuthError" || error.name === "ClientAuthError") {
if (
error.name === "AuthError" ||
error.name === "ClientAuthError" ||
error.name === "BrowserAuthError"
) {
const msalError = error as msalCommon.AuthError;
switch (msalError.errorCode) {
case "endpoints_resolution_error":
Expand All @@ -167,10 +171,11 @@ export class MsalBaseUtilities {
break;
}
}
if (error.name === "ClientConfigurationError") {
return error;
}
if (error.name === "AbortError") {
if (
error.name === "ClientConfigurationError" ||
error.name === "BrowserConfigurationAuthError" ||
error.name === "AbortError"
) {
return error;
}
return new AuthenticationRequired(scopes, getTokenOptions, error.message);
Expand Down

0 comments on commit d67b645

Please sign in to comment.