Skip to content

feat(auth2): Implement flexible configuration for AuthSession expiration - #3631

Merged
tp merged 7 commits into
serverpod:mainfrom
tp:api-token-functionality-in-sessions
Jun 11, 2025
Merged

tp merged 7 commits into
serverpod:mainfrom
tp:api-token-functionality-in-sessions

Conversation

@tp

@tp tp commented Jun 11, 2025 •

Copy link
Copy Markdown
Contributor

Applies the flexible configurations from #3618 to AuthSession, thus making the "API Tokens" feature obsolete.

Extends the AuthSessions with 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 lastUsed timestamp (with 1 minute-resolution to avoid excessive database updates).

@tp
tp force-pushed the api-token-functionality-in-sessions branch from cfeb0bf to c16b5b6 Compare June 11, 2025 10:42
@tp
tp requested a review from SandPod June 11, 2025 11:00

@SandPod SandPod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice, but a couple of comments for improvements.

I'll approve it but reach out if there is anything unclear.

@tp tp changed the title feat(auth2): Implement flexible configuration as in API token in serverpod_auth_session feat(auth2): Implement flexible configuration for AuthSession expiration Jun 11, 2025
@tp
tp merged commit 35c5483 into serverpod:main Jun 11, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants