Skip to content

Conversation

felixxm
Copy link
Member

@felixxm felixxm commented Aug 20, 2025

In alogout(), there is no need to check the is_authenticated attribute when user is None.

In aget_user(), there is no need to call get_session_auth_hash() twice.

Follow up to 50f89ae.

In alogout(), there is no need to check the is_authenticated attribute
when user is None.

In aget_user(), there is no need to call get_session_auth_hash() twice.

Follow up to 50f89ae.
session_auth_hash = user.get_session_auth_hash()
session_hash_verified = session_hash and constant_time_compare(
session_hash, user.get_session_auth_hash()
session_hash_verified = constant_time_compare(
Copy link
Member Author

Choose a reason for hiding this comment

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

session_hash is always truthy here.

Copy link
Contributor

@sarahboyce sarahboyce left a comment

Choose a reason for hiding this comment

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

Thank you 👍

@felixxm
Copy link
Member Author

felixxm commented Aug 20, 2025

@sarahboyce Thanks for checking 👍

@felixxm felixxm merged commit 7063d31 into django:main Aug 20, 2025
34 checks passed
@felixxm felixxm deleted the refs-35303-opt branch August 20, 2025 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants