Catch PhoneNumberUnoccupied in /login/send_code provisioning API
This commit is contained in:
@@ -279,6 +279,14 @@ class AuthAPI(abc.ABC):
|
||||
errcode="phone_code_expired",
|
||||
error="Phone code expired.",
|
||||
)
|
||||
except PhoneNumberUnoccupiedError:
|
||||
return self.get_login_response(
|
||||
mxid=user.mxid,
|
||||
state="code",
|
||||
status=403,
|
||||
errcode="phone_number_unoccupied",
|
||||
error="That phone number has not been registered.",
|
||||
)
|
||||
except SessionPasswordNeededError:
|
||||
if not password_in_data:
|
||||
if user.command_status and user.command_status["action"] == "Login":
|
||||
|
||||
Reference in New Issue
Block a user