-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Remove invalid prompt for silent request instead of throwing an error #6895
Conversation
); | ||
delete request.prompt; |
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.
Objects are passed by reference so this can have unintended effects elsewhere - I suggest removing this and changing the logic below to prompt: request.prompt === PromptValue.NO_SESSION ? PromptValue.NO_SESSION : PromptValue.NONE
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.
Alternatively you can spread the input object into a new object at the top of the function and then manipulate the new one as you wish
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 point. Fixed
if ( | ||
request.prompt && | ||
request.prompt !== PromptValue.NONE && | ||
request.prompt !== PromptValue.NO_SESSION | ||
) { | ||
throw createBrowserAuthError( | ||
BrowserAuthErrorCodes.silentPromptValueError | ||
this.logger.verbose( |
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.
A higher log level seems appropriate here
this.logger.verbose( | |
this.logger.warning( |
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
0a35206
to
2ab4829
Compare
Fixes an issue when request prompt bleeds from msal-react MsalAuthenticationTemplate into ATS silentIframeClient.