Fixed NPE on the /auth endpoint in case the user response is already a UserAuthStatus.

This commit is contained in:
Fabio Manganiello 2024-07-27 21:47:55 +02:00
parent 0071fc54b3
commit 8b6c1fb969
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -233,7 +233,11 @@ def _auth_get():
status = response
if status:
return UserAuthStatus.by_status(status).to_response() # type: ignore
if not isinstance(status, UserAuthStatus):
status = UserAuthStatus.by_status(status)
if not status:
status = UserAuthStatus.INVALID_CREDENTIALS
return status.to_response()
return UserAuthStatus.INVALID_CREDENTIALS.to_response()