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
[msal-common][msal-browser] Add support for sub error codes #1533
Conversation
…soft-authentication-library-for-js into msal-common-sub-errors
…tion-library-for-js into msal-common-sub-errors
static isInteractionRequiredError(errorCode: string, errorString: string, subError?: string) : boolean { | ||
const isInteractionRequiredErrorCode = !StringUtils.isEmpty(errorCode) && Object.values(InteractionRequiredAuthErrorMessage).includes(errorCode); | ||
const isInteractionRequiredSubError = !StringUtils.isEmpty(subError) && Object.values(InteractionRequiredAuthSubErrorMessage).includes(subError); | ||
const isInteractionRequiredErrorDesc = !StringUtils.isEmpty(errorString) && Object.values(InteractionRequiredAuthErrorMessage).some((irErrorCode) => { |
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.
Object.values
is not supported in IE: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values
I'm not sure if Typescript provides a polyfill, can you check to see if this works in IE11?
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.
Good to know. Will look into it.
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.
Done
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.
Looks good!
This PR builds on #1451 and will close #1348
It adds support for sub-error codes returned from the /token endpoint indicating that interaction is required