-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: InactivitySessionTimeoutMiddleware
: Check for last_login
(allow Django admin login + access)
#7260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👷 Deploy request for heartex-docs pending review.Visit the deploys page to approve it
|
👷 Deploy request for label-studio-docs-new-theme pending review.Visit the deploys page to approve it
|
Only check for last_login when it is actually set in the session. Otherwise a user is immediately logged out when not logged in via the user_login view (for example via the Django admin)
4546f40
to
38653b7
Compare
/git merge develop
|
@makseq Hi, could you merge the branch manually? All workflows fail because they require a token: As I'm an outside contributor, I don't have access to this token. And now I receive notifications the pipeline fails, each and every night ;) |
…sion-timeout-middleware-last-login
✅ Deploy Preview for label-studio-storybook canceled.
|
@maerteijn sorry for the delay, could you please resolve Linter errors? And I think we can merge it finally
|
/git merge develop
|
Reapply this PR: The original PR was closed due to inactivity,
Please reconsider and if you do not want to merge it a valid reason why not would be much appreciated.
PR fulfills these requirements
[fix|feat|ci|chore|doc]: TICKET-ID: Short description of change made
ex.fix: DEV-XXXX: Removed inconsistent code usage causing intermittent errors
s/features)
Note: I do not (yet) understand what should be the
TICKET-ID
and how to decide the commit message with this prefixDEV-XXXX
, therefore I left it empty for now and just added the commit message. (Suggestion: Add documentation for outside collaborators how they can determine this).Change has impacts in these area(s)
(check all that apply)
Not really sure which one to choose.
Describe the reason for change
Allows login into the Django admin "Out-of-the-box", and makes sure no
last_login
comparison is made when never logged in. See also the issue Admin Page - Not letting login #4083What does this fix?
Allow users to login via the Django admin login screen (
/admin/login
)What is the new behavior?
The
InactivitySessionTimeoutMiddleware
won't automatically logout a user whenlast_login
is not set in the user session.What is the current behavior?
The
InactivitySessionTimeoutMiddleware
logs out all users which do not have thelast_login
value set > 0 in the user session.What libraries were added/updated?
N/A
Does this change affect performance?
No
Does this change affect security?
No
What alternative approaches were there?
I suggest to completely remove the
InactivitySessionTimeoutMiddleware
in a future release. Session expiration time can be set out of the box via the SESSION_COOKIE_AGE.If manual extension / adjustion of the session time is required, you can use the .set_expiry() method. (In the
/users/login
view for example).What feature flags were used to cover this change?
N/A
Does this PR introduce a breaking change?
(check only one)
What level of testing was included in the change?
(check all that apply)
Which logical domain(s) does this change affect?
(for bug fixes/features, be as precise as possible. ex. Authentication, Annotation History, Review Stream etc.)
Authentication