-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix(session): Do not update authtoken last_check for passwordless #44670
fix(session): Do not update authtoken last_check for passwordless #44670
Conversation
/backport to stable28 |
/backport to stable27 |
Does this reintroduce #29678 ? |
Good catch but I don't think so. The old issue was that we missed to updated last_check when we actually did check the password. Here we skip the update intentionally because no checks are performed. For the path of password checks the token update is still in place: server/lib/private/User/Session.php Line 787 in cc42b2e
The unit test added covers an assertion for the token update. |
Tested by setting the last_activity to 0 and the timestamp is updated. |
Signed-off-by: Christoph Wurst <[email protected]>
cc42b2e
to
21ee7f5
Compare
/backport to stable26 |
/backport to stable29 |
Summary
The column oc_authtoken.last_check is used to debounce the password checks of the login password encoded in app passwords. If instances have set
auth.storeCryptedPassword
tofalse
, the password column stays NULL and there is no password check. In that case we keep the last_check column updated without any actual check performed. This is superfluous.How to test
auth.storeCryptedPassword => false,
in config/config.phpcurl -u "USER:APPPASSWORD" https://localhost/apps/files
Master: last_check is set to the current timestamp. This indicates that there was an UPDATE query.
Here: last_check remains 0.
Note: in reality last_check will stay at the time of token creation. You can skip setting last_check to 0 but then you have to wait more than five minutes between creating and using the token.
Checklist