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

Add created_at attribute to each token #1603

Open
nicholas-nicolau opened this issue Jun 14, 2023 · 0 comments
Open

Add created_at attribute to each token #1603

nicholas-nicolau opened this issue Jun 14, 2023 · 0 comments

Comments

@nicholas-nicolau
Copy link

Hi, everyone.

Recently I faced a really strange problem and it took me a while to understand it fully.
I reduced the token expiration time from 3 weeks to some minutes and then the users couldn't log in my application anymore, I realized that the user was logging in, receiving a new token but the new token was not being persisted on the database.

The problem was that I allowed just one connected device (through 'max_number_of_devices' config) and the criteria to clear old tokens was based on the expiration time - leaving only the token that will take longer to expiry - so my new 'expiry in minutes token' had been deleted every time it was created.

I'm not sure about why there isn't a 'created_at' attribute to track tokens so I'll leave this issue here, if it seems promising I'll open a PR.

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

No branches or pull requests

1 participant