Skip to content

Commit

Permalink
Send M_TOKEN_INCORRECT as per MSC4183
Browse files Browse the repository at this point in the history
  • Loading branch information
dbkr committed Aug 29, 2024
1 parent a37d60b commit 8e5447a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions sydent/http/servlets/emailservlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,11 @@ def do_validate_request(self, request: Request) -> JsonDict:
"error": "The token doesn't match",
}
except IncorrectSessionTokenException:
request.setResponseCode(400)
return {
"success": False,
"errcode": "M_NO_VALID_SESSION",
"error": "No session could be found with this sid",
"errcode": "M_TOKEN_INCORRECT",
"error": "The token supplied is incorrect",
}

def render_OPTIONS(self, request: Request) -> bytes:
Expand Down
6 changes: 3 additions & 3 deletions sydent/http/servlets/msisdnservlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,11 @@ def do_validate_request(self, request: Request) -> JsonDict:
"error": "The token doesn't match",
}
except IncorrectSessionTokenException:
request.setResponseCode(404)
request.setResponseCode(400)
return {
"success": False,
"errcode": "M_NO_VALID_SESSION",
"error": "No session could be found with this sid",
"errcode": "M_TOKEN_INCORRECT",
"error": "The token supplied is incorrect",
}

def render_OPTIONS(self, request: Request) -> bytes:
Expand Down

0 comments on commit 8e5447a

Please sign in to comment.