Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: inadvertent cookie deletion when changing user password via PatchUser #4637

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

RogerHYang
Copy link
Contributor

@RogerHYang RogerHYang commented Sep 17, 2024

No description provided.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Sep 17, 2024
@@ -145,9 +143,6 @@ async def hash_password(password: str, salt: bytes) -> bytes:
async def log_out(self, user_id: int) -> None:
assert self.token_store is not None
await self.token_store.log_out(UserId(user_id))
response = self.get_response()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think to make this clearer you could name the method log_out_user - then it's clear that you are not logging out the current user

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since it already takes an argument it's a bit redundant at the call site, e.g.

log_out(user.id)

vs.

log_out_user(user.id)

Copy link
Contributor Author

@RogerHYang RogerHYang Sep 17, 2024

Choose a reason for hiding this comment

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

the inclusion of cookies was an oversight because it was an overstep of single responsibility

@RogerHYang RogerHYang merged commit 0dd7e0e into auth Sep 17, 2024
17 checks passed
@RogerHYang RogerHYang deleted the incorrect-cookie-deletion branch September 17, 2024 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants