Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def auth_signup_api(request) -> Response:
return error_response or Response(
{"error": "Failed to create user session"}, status=500
)
if user.has_usable_password():
if user.password:
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check if user.password: is insufficient and potentially incorrect. This will treat users with unusable passwords (marked with special prefixes like "!") as if they have valid passwords, which could prevent legitimate signups.

The underlying issue is that user_model.objects.get_or_create() in create_user_session() doesn't call set_unusable_password(), leaving the password field as an empty string. A more robust solution would be to:

  1. Modify create_user_session() to explicitly set an unusable password when creating new users, OR
  2. Check both if the password exists AND if it's usable with a condition like: if user.password and user.has_usable_password():

The current change could block users who have unusable password markers from completing signup.

Suggested change
if user.password:
if user.password and user.has_usable_password():

Copilot uses AI. Check for mistakes.
return Response({"error": "User already exists with password."}, status=409)

user.is_active = True
Expand Down
Loading