forked from p15670423/monkey
Island: Add note about 401 for invalid credentials
This commit is contained in:
parent
f086637758
commit
5938382627
|
@ -28,5 +28,7 @@ class Registration(AbstractResource):
|
||||||
self._authentication_service.register_new_user(username, password)
|
self._authentication_service.register_new_user(username, password)
|
||||||
return make_response({"error": ""}, HTTPStatus.OK)
|
return make_response({"error": ""}, HTTPStatus.OK)
|
||||||
# API Spec: HTTP status code for AlreadyRegisteredError should be 409 (CONFLICT)
|
# API Spec: HTTP status code for AlreadyRegisteredError should be 409 (CONFLICT)
|
||||||
|
# API Spec: HTTP status code for InvalidRegistrationCredentialsError should be 401
|
||||||
|
# (UNAUTHORIZED). See https://www.rfc-editor.org/rfc/rfc7235#section-3.1
|
||||||
except (InvalidRegistrationCredentialsError, AlreadyRegisteredError) as e:
|
except (InvalidRegistrationCredentialsError, AlreadyRegisteredError) as e:
|
||||||
return make_response({"error": str(e)}, HTTPStatus.BAD_REQUEST)
|
return make_response({"error": str(e)}, HTTPStatus.BAD_REQUEST)
|
||||||
|
|
Loading…
Reference in New Issue