[auth] Fix update to user's last active time#15318
Open
kush-chandra wants to merge 1 commit intohail-is:mainfrom
Open
[auth] Fix update to user's last active time#15318kush-chandra wants to merge 1 commit intohail-is:mainfrom
kush-chandra wants to merge 1 commit intohail-is:mainfrom
Conversation
grohli
reviewed
Mar 10, 2026
Contributor
grohli
left a comment
There was a problem hiding this comment.
Looks good! One minor question/comment but other than that it should be good to go.
| userdata = await get_userinfo_from_login_id_or_hail_identity_id(request, uid) | ||
|
|
||
| if userdata: | ||
| if userdata['state'] == 'active': |
Contributor
There was a problem hiding this comment.
If we hit this then I assume we got some non-None thing back from either get_userinfo_from_login_id_or_hail_identity_id() or get_userinfo_from_hail_session_id()? It looks like both of those functions already check/query for users.state = 'active', so it may be alright to drop this check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
Currently, we only update a user's last active time if they have an existing active session. However, this excludes some scenarios (ex. calls through the CLI) where the user might not have created a session with a given auth token. This change makes it so when authorizing a call, we will always update the last active time as long as the user is authorized & currently active.
Security Assessment
Impact Rating
Impact Description
Refactoring where the update to a user's last active time happens. This adds one database update on some authorized calls which didn't have it before.
Appsec Review