-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Warn users and delete user accounts after period of inactivity #2088
Conversation
β¦ts and update revert migration
We will probably need a scheduler to be able to periodically warn and delete inactive users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we add a db connection on each login_required call, I think this means the update is done for every single endpoint called.
Instead, would it be better to add this logic to the /me endpoint only, when the login details are retreived (on first page load)?
Could you simply add to the select SQL .one
logic something like UPDATE users SET last_login_at = NOW() WHERE id = %(user_id)s;
You could probably merge this into the existing logic, adding a RETURNING clause to get the user after update |
add migration in fmtm_base_schema as well |
β¦onstraint from project author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work! π
Note to self: needs a cron to run this as a final step, but for now the admin calling the endpoint periodically also works
Signed-off-by: Anuj Gupta <[email protected]>
What type of PR is this? (check all applicable)
Related Issue
Describe this PR
added a new field to track users last active date based on login in users table
added a task endpoint to warn users before deletion and delete users if the inactivity threshold has been met.
Checklist before requesting a review
[optional] What gif best describes this PR or how it makes you feel?