forked from platypush/platypush
Fixed NPE on the /auth
endpoint in case the user response is already a UserAuthStatus.
This commit is contained in:
parent
0071fc54b3
commit
8b6c1fb969
1 changed files with 5 additions and 1 deletions
|
@ -233,7 +233,11 @@ def _auth_get():
|
||||||
status = response
|
status = response
|
||||||
|
|
||||||
if status:
|
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()
|
return UserAuthStatus.INVALID_CREDENTIALS.to_response()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue