Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Return the same error message from /login when password is incorrect and when account doesn't exist. #12738

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions changelog.d/12738.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change error message when attempting to login to a non-existent account to match that returned when the account exists but the password is invalid. Contributed by Daniel Aloni.
DMRobertson marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion synapse/handlers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ async def validate_login(
await self._failed_login_attempts_ratelimiter.can_do_action(
None, (medium, address)
)
raise LoginError(403, "", errcode=Codes.FORBIDDEN)
raise LoginError(403, "Invalid password", errcode=Codes.FORBIDDEN)

identifier_dict = {"type": "m.id.user", "user": user_id}

Expand Down