-
Notifications
You must be signed in to change notification settings - Fork 27
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
♻️ Expired confirmation tokens are logged and INVITATION tokens do not expire #3440
♻️ Expired confirmation tokens are logged and INVITATION tokens do not expire #3440
Conversation
5afaa3b
to
ed46d78
Compare
Codecov Report
@@ Coverage Diff @@
## master #3440 +/- ##
======================================
Coverage 83.2% 83.3%
======================================
Files 822 822
Lines 34911 34915 +4
Branches 1255 1255
======================================
+ Hits 29080 29098 +18
+ Misses 5645 5631 -14
Partials 186 186
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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.
99 years... we'll be old...
What do these changes do?
During a demo today, an invitation link did not work and was reported as "expired". At first glance, we did not understand why this happened and took us some time to recall that actually all confirmation tokens are time-limited. The problem was that the invitations that we were using were already expired but it was not obvious from the info available (no logs, no indication in the database, etc)
This PR aims to avoid this problem in the future by:
Some insights:
Some actions in a login require some sort of confirmation/validation step. For those we create confirmation tokens that, due to security reasons, have a limited lifetime. These tokens are used for actions like invitations, confirmation of emails, etc. The expiration date is based on the creation timestamp and a
LIFETIME
variable underlogin.settings.LoginOptions
.Related issue/s
How to test
cd services/web/server make install-dev pytest tests/unit/with_dbs/03/test_login_registration.py