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

Don't allow the newly created token to be ejected in clean_old_tokens #1618

Open
theblang opened this issue Feb 29, 2024 · 4 comments
Open

Comments

@theblang
Copy link
Contributor

We hit an odd situation with our Pingdom user, where it ended up having 10 tokens (the default max_number_of_devices) with an expiry slightly too far into the future. That in itself is still a mystery. But it caused a situation where the user couldn't log in, because the newly created token (with a proper expiry) was the one being ejected in clean_old_tokens. I think we should change that logic to never eject the token that was just created, otherwise the user can't sign in. Barring my odd situation, you might do something like change token_lifespan to be earlier.

@dalima-dev
Copy link

Got same problem here, me and my team suspect of this year being a leap year is causing that behavior.

@theblang
Copy link
Contributor Author

me and my team suspect of this year being a leap year is causing that behavior.

Ahh, that's a good thought!

@pedroara
Copy link

Although I think we should focus on cause of the tokens that get generated with a larger expiry than the configured lifespan the changes you suggest could solve the problem

@MaicolBen
Copy link
Collaborator

I could know how to fix it but I wasn't able to reproduce it with a test, so any more reproduction info is useful.

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

4 participants