Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Check session expiration on login #1549

Merged
merged 1 commit into from
Jan 10, 2021
Merged

Check session expiration on login #1549

merged 1 commit into from
Jan 10, 2021

Conversation

sethvargo
Copy link
Member

Prior to this commit, the login page would re-authenticate, even if the time since last activity exceeded the configuration. This forces the login controller to check the session TTL before rendering the HTML (which would refresh the TTL).

Release Note

Check session expiration on login

/assign @whaught

This fixes an issue where a realm has configured session expiration, but the user lands on the login page. Prior to this commit, the login page would re-authenticate, even if the time since last activity exceeded the configuration. This forces the login controller to check the session TTL before rendering the HTML (which would refresh the TTL).
@googlebot googlebot added the cla: yes Auto: added by CLA bot when all committers have signed a CLA. label Jan 10, 2021
@@ -53,8 +53,6 @@ func RequireAuth(cacher cache.Cacher, authProvider auth.Provider, db *database.D
// If it's been more than the TTL since we've seen this session,
// expire it by creating a new empty session.
if time.Since(t) > sessionIdleTTL {
authProvider.ClearSession(ctx, session)
Copy link
Member Author

Choose a reason for hiding this comment

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

Clearing the session here actually makes it so the login controller "forgets" which session to revoke.

@sethvargo
Copy link
Member Author

/assign @whaught

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sethvargo, whaught

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot google-oss-robot merged commit 09af0aa into main Jan 10, 2021
@google-oss-robot google-oss-robot deleted the sethvargo/timeout branch January 10, 2021 17:53
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Auto: added by CLA bot when all committers have signed a CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants