fix: deprecate passwords, use phone auth source of truth

This commit is contained in:
2026-03-14 00:47:31 +03:00
parent c391a9b8e5
commit 0b76356169
4 changed files with 60 additions and 2 deletions
@@ -91,3 +91,17 @@ def test_db_rejects_duplicate_phone_number():
User.objects.create_user(phone_number="+966512345678")
with pytest.raises(IntegrityError):
User.objects.create_user(phone_number="+966512345678")
@pytest.mark.django_db
def test_password_token_endpoint_is_disabled(client):
User.objects.create_user(phone_number="+966512345678", password="StrongPass123")
response = client.post(
reverse("token_obtain_pair"),
{"phone_number": "+966512345678", "password": "StrongPass123"},
content_type="application/json",
)
assert response.status_code == 410
assert "detail" in response.json()