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

Commit

Permalink
Better errcode when pw reset emails are disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson committed Jul 5, 2022
1 parent 3319732 commit 9a47994
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion synapse/rest/client/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.
import logging
import random
from http import HTTPStatus
from typing import TYPE_CHECKING, Optional, Tuple
from urllib.parse import urlparse

Expand Down Expand Up @@ -82,7 +83,9 @@ async def on_POST(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
"User password resets have been disabled due to lack of email config"
)
raise SynapseError(
400, "Email-based password resets have been disabled on this server"
HTTPStatus.NOT_FOUND,
"Email-based password resets have been disabled on this server",
Codes.NOT_FOUND,
)

body = parse_json_object_from_request(request)
Expand Down

0 comments on commit 9a47994

Please sign in to comment.