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 settings for mail_validation to allow for reusable and time-expiring codes #202

Closed
scottp-dpaw opened this issue Feb 23, 2018 · 1 comment
Labels
stale Stale issues (closing soon)

Comments

@scottp-dpaw
Copy link
Contributor

We have a number of apps deployed with PSA set up in email authentication mode. For the most part it works okay, but since the introduction of single-use code verification the process falls over for a small number of users:

  • User asks for a verification email to log in
  • Verification email is sent to the user with a code
  • Awful security appliance on user's network intercepts the email/the user's session and visits the link first, eating the session cookie
  • Awful security appliance gets a 302 and hands that back to the user
  • User gets told that their token has expired and to try again
  • Repeat

To fix this, we've added two optional settings:

  • EMAIL_VALIDATION_ALLOW_REUSE (bool): validate_email() will not return False for verified codes
  • EMAIL_VALIDATION_EXPIRED_THRESHOLD (int): validate_email() will return False if the code has a timestamp and is more than [int] seconds in the past
@omab omab added the stale Stale issues (closing soon) label Mar 21, 2020
@omab omab closed this as completed Mar 21, 2020
@GregoryAveryWeir
Copy link

We've run into this issue with a user; I'm not sure if this is the correct solution, but the PR or an alternate solution should be considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale issues (closing soon)
Development

No branches or pull requests

3 participants