Skip to content

Conversation

ncoop57
Copy link
Contributor

@ncoop57 ncoop57 commented Aug 12, 2025

Many websites have started adding a "logout all devices" option, allowing users to revoke access if a specific device or session is compromised. This PR demonstrates a minimal example of how to implement similar functionality. Specifically, each time a user logs in, that login session has a timestamp saved to it. And then in the user table, each user has a logout_time column that is updated any time the user goes through the logout flow. We then use the check_invalid function from the FastHTML OAuth class to determine whether the current session's timestamp is still valid by checking if it's after the last logout period.

Co-authored-by: RensDimmendaal <[email protected]>
@ncoop57 ncoop57 marked this pull request as ready for review August 12, 2025 15:51
@ncoop57 ncoop57 requested a review from jph00 August 12, 2025 15:51
Copy link
Contributor

@jph00 jph00 left a comment

Choose a reason for hiding this comment

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

Thanks @ncoop57 ! :) Maybe add a README to explain what this is? I also added some minor suggestions for clarity

ncoop57 and others added 7 commits August 15, 2025 08:18
Co-authored-by: Jeremy Howard <[email protected]>
Co-authored-by: Jeremy Howard <[email protected]>
Co-authored-by: Jeremy Howard <[email protected]>
Co-authored-by: Jeremy Howard <[email protected]>
Co-authored-by: Jeremy Howard <[email protected]>
Co-authored-by: Jeremy Howard <[email protected]>
Co-authored-by: Jeremy Howard <[email protected]>
@ncoop57
Copy link
Contributor Author

ncoop57 commented Sep 12, 2025

sorry for taking long on this. It is still something I will come back to when I have time to finalize @jph00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants