feat: deprecate email, pre-verify users + documentation

This commit is contained in:
2026-03-14 14:40:52 +03:00
parent ad711d1daf
commit 9787fb699a
13 changed files with 223 additions and 21 deletions
@@ -76,3 +76,25 @@ def test_phone_auth_refresh_endpoint_still_works(client):
)
assert refresh_response.status_code == 200
assert "access" in refresh_response.json()
@pytest.mark.django_db
@override_settings(OTP_PROVIDER="console")
def test_phone_auth_verify_returns_404_when_user_removed(client):
with patch("apps.accounts.services.otp.generate_code", return_value="123456"):
request_response = client.post(
reverse("phone_auth_request"),
{"phone_number": "0512345678", "channel": "sms"},
content_type="application/json",
)
request_id = request_response.json()["request_id"]
User.objects.filter(phone_number="+966512345678").delete()
verify_response = client.post(
reverse("phone_auth_verify"),
{"request_id": request_id, "code": "123456"},
content_type="application/json",
)
assert verify_response.status_code == 404