Skip to content
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

Auto sign-out #4107

Open
johnnyjoygh opened this issue Nov 7, 2024 Discussed in #4075 · 6 comments
Open

Auto sign-out #4107

johnnyjoygh opened this issue Nov 7, 2024 Discussed in #4075 · 6 comments
Labels
enhancement New feature or request

Comments

@johnnyjoygh
Copy link
Collaborator

Discussed in https://github.com/orgs/usememos/discussions/4075

Originally posted by rathmannm October 31, 2024
Hi,

I'm storing sensitive contents in Memos so it would be nice to have an auto sign-out feature where you can specify after how many minutes you get signed out automatically.

@johnnyjoygh johnnyjoygh added the enhancement New feature or request label Nov 7, 2024
@github-actions github-actions bot added the Stale label Nov 21, 2024
@JodhwaniMadhur
Copy link
Contributor

can someone tell me about the DB structure and a bit of the API documentation?

my plan to implement this is to store the last-login-time and log-out-after data in the db and check if the curr-time subracted from the last-login time is greater than the log-out-after time and log out the user based on that.

we can add the UI for setting the "log out after time" in the preferences page.

@johnnyjoygh
Copy link
Collaborator Author

@JodhwaniMadhur I think the point of this issue is to make the access token duration configurable, which is now 1 week by default. https://github.com/usememos/memos/blob/main/server/router/api/v1/auth.go#L18

@JodhwaniMadhur
Copy link
Contributor

oh ok, thanks for the guidance, will make the feature work this way.

@RoccoSmit
Copy link
Contributor

RoccoSmit commented Nov 25, 2024

To add to @johnnyjoygh 's comment. I believe there are 2 places to take into consideration. At registration the expiry is set to 7 days in the future, subsequent logins set the expiry 1 year in the future.

@RoccoSmit
Copy link
Contributor

RoccoSmit commented Nov 25, 2024

I found the reference to the two locations #4009 (comment)

@RoccoSmit
Copy link
Contributor

RoccoSmit commented Nov 25, 2024

@JodhwaniMadhur, out of interest, how are you intending to capture a large range of timeout possibilities? Current timeout is in days (multiplied for years), OP seems like they need timeout in minutes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants