Skip to content

Commit

Permalink
fix: Email token validation response (#21036)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite authored Mar 20, 2024
1 parent 53355af commit c96f6b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions posthog/api/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ def get_object(self):
def retrieve(self, request: Request, *args: Any, **kwargs: Any) -> Response:
response = super().retrieve(request, *args, **kwargs)
response.status_code = self.SUCCESS_STATUS_CODE
response.data = None
return response


Expand Down
1 change: 1 addition & 0 deletions posthog/api/test/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ def test_can_validate_token(self):
response = self.client.get(f"/api/reset/{self.user.uuid}/?token={token}")
self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)
self.assertEqual(response.content.decode(), "")
self.assertEqual(response.headers["Content-Length"], "0")

def test_cant_validate_token_without_a_token(self):
response = self.client.get(f"/api/reset/{self.user.uuid}/")
Expand Down

0 comments on commit c96f6b5

Please sign in to comment.