You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you pass an undefined string to useAuthorizationIam for urn, a request is still sent with the urn as undefined
This is because the following line will be evaluated as undefined (instead of false): urn && urn.length > 0 && actions && actions.length > 0 && isTrigger,
And as a result, tanstack consider that enabled isn't given to the useQuery.
A similar issue happens when you pass an empty string (but it will throw an error on tanstack side)
To fix this issue, we should replace the previously mentioned line by this one: Boolean(urn) && urn.length > 0 && Boolean(actions) && actions.length > 0 && isTrigger
This way it would ensure that if we pass either an empty string or undefined to useAuthorizationIam, the enabled property given to useQuery will always be a boolean
Steps to reproduce
Call useAuthorizationIam with either an empty string or undefined
Browser
No response
Operating System
macOS
Windows
Linux
Additional Information
No response
The text was updated successfully, but these errors were encountered:
On which entity, you would like to report a bug?
src/hooks/iam/useOvhIam.tsx
Description
When you pass an undefined string to useAuthorizationIam for urn, a request is still sent with the urn as undefined
This is because the following line will be evaluated as undefined (instead of false):
urn && urn.length > 0 && actions && actions.length > 0 && isTrigger,
And as a result, tanstack consider that enabled isn't given to the useQuery.
A similar issue happens when you pass an empty string (but it will throw an error on tanstack side)
To fix this issue, we should replace the previously mentioned line by this one:
Boolean(urn) && urn.length > 0 && Boolean(actions) && actions.length > 0 && isTrigger
This way it would ensure that if we pass either an empty string or undefined to useAuthorizationIam, the enabled property given to useQuery will always be a boolean
Steps to reproduce
Call useAuthorizationIam with either an empty string or undefined
Browser
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: