Repository navigation
feat(auth2): Implement flexible configuration for AuthSession expiration - #3631
Merged
Merged
Conversation
…verpod_auth_session`
tp
force-pushed
the
api-token-functionality-in-sessions
branch
from
June 11, 2025 10:42
cfeb0bf to
c16b5b6
Compare
SandPod
approved these changes
Jun 11, 2025
SandPod
left a comment
Contributor
There was a problem hiding this comment.
Nice, but a couple of comments for improvements.
I'll approve it but reach out if there is anything unclear.
…via `!` after check
…en user; add `findSessions` as an "admin" method
…uring `setUp` and then only run one verification/assertion per `test`
serverpod_auth_sessionAuthSession expiration
tp
commented
Jun 11, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Applies the flexible configurations from #3618 to
AuthSession, thus making the "API Tokens" feature obsolete.Extends the
AuthSessionswith fixed and inactivity-related expiration options.These new options can be configured when creation each individual session, and do not rely on a global configuration anymore.
Thus this package can be used for both "normal" user sessions, but also long lived service accounts / API tokens, or even never-expiring anonymous accounts.
To allow a better understanding of the system, and to support inactivity-based expiration, each session now tracks a
lastUsedtimestamp (with 1 minute-resolution to avoid excessive database updates).