-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add check for empty object string in claims request parameter #3579
Conversation
@@ -77,8 +77,9 @@ describe("AuthToken.ts Class Unit Tests", () => { | |||
it("Throws error if rawIdToken is null or empty", () => { | |||
expect(() => new AuthToken("", cryptoInterface)).to.throw(ClientAuthErrorMessage.nullOrEmptyToken.desc); | |||
expect(() => new AuthToken("", cryptoInterface)).to.throw(ClientAuthError); | |||
|
|||
// @ts-ignore |
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.
exception to function params being non-nullable?
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.
Can we just add an exception to tests?
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.
this is more to test vanilla JS scenarios. Typescript will catch them regardless. We are making some changes to our tests, one of them may be to test vanilla JS and typescript separately.
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.
Can we just add an exception to tests?
Not sure what you mean.
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.
Allow null in function params for test files in lint rules.
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.
I don't think this is lint, this is typescript. We are doing what you are saying by adding ts-ignore
to the file.
🎉 We recommend upgrading to the latest version of Handy links: |
This PR checks whether the object passed to the claims parameter is not an empty object. This prevents unnecessary cache skips when the empty object is provided, as we are only required to skip if additional claims are requested.