-
Notifications
You must be signed in to change notification settings - Fork 24
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
Make token expires for AccountVerifyView #134
Conversation
By default `signing.loads` has `max_age` sets to `None` which makes the token to validate an account to never expire.
settings, | ||
'VERIFY_ACCOUNT_EXPIRY', | ||
self.DEFAULT_VERIFY_ACCOUNT_EXPIRY, | ||
) |
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.
try:
max_age = settings.VERIFY_ACCOUNT_EXPIRY
except AttributeError:
max_age = self.DEFAULT_VERIFY_ACCOUNT_EXPIRY
4025bcd
to
6f22616
Compare
@Ian-Foote @meshy can you review/merge? |
Set user as a class attribute or raise an `InvalidExpiredToken`. | ||
""" | ||
try: | ||
email_data = signing.loads(kwargs['token']) | ||
max_age = settings.VERIFY_ACCOUNT_EXPIRY |
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.
Might it make more sense to add this to an app config?
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.
or, failing that, on this view?
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.
Hmm, maybe. I don't think it matters much.
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.
I was thinking about the app config, maybe we should wait until we drop support for 1.6
Make token expires for AccountVerifyView
By default
signing.loads
hasmax_age
sets toNone
which makes thetoken to validate an account to never expire.