Open fabiothz opened 2 years ago
Hey @fabiothz. Nice catch, this really shouldn't happen.
Personally, I would expect an error to be thrown here. Something like a UserNotFound
exception. This would be the most explicit and customizable behavior I can think of. I would wait for @JonasScholl opinion on this
I believe this can now be closed! @fabiothz Are you still experiencing the issue with the latest release?
Wen i try to search for a user that doesn't exist, an error occurs:
Occurs in the line below, as the API returns a empty array.
https://github.com/code-specialist/fastapi-keycloak/blob/28f5f7bf18c25c8677202ad2f1d3c2437763a58d/fastapi_keycloak/api.py#L833
A suggestion would be to check before instantiating the object:
This way the API will allow me to check if a user exists in keycloak. What do you think?