-
Notifications
You must be signed in to change notification settings - Fork 1k
Remember device for 30 days option #14194
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
Conversation
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.
Added comments inline - overall looks like a nice patch.
eb0d81d
to
557ef2d
Compare
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'm pretty good with this, but would appreciate a second review from @di as well.
"REMEMBER_DEVICE_DAYS", | ||
coercer=int, | ||
default=30, |
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.
praise: I like this even more, since then we don't even need to set a value unless we want to override the default of 30 days.
random |
fa103c1
to
d7db58d
Compare
@di It looks like this PR is waiting for your review. Btw, if you re-run the failed checks, they should pass (temporary github issue). |
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.
Thanks! FYI, translations need to be updated.
- Also cleaned up tests - Also changed cookie to strict
d7db58d
to
c84da1e
Compare
Thanks, all! |
This gives the user the option to not have to provide 2nd factor authentication on a device for 30 days. A new cookie
remember_device
will contain a signed token that allows the user to skip two-factor authentication (assuming the token is valid). To minimize data being sent by the browser, this cookie is only sent for requests with the pathaccounts/login
.This is how the 2FA page looks:
With authenticator app and webauthn
With only webauthn
By default "Remember this device for 30 days" will not be checked.
I originally created a different PR for this issue (#13166) but since we decided to take a substantially different approach, I figured this merited a new, clean PR.
This change requires adding a
TOKEN_REMEMBER_DEVICE_SECRET
environment variable to the production configuration.Closes #5867
I'll create a new issue for how these tokens can be revoked. One approach could be to invalidate the tokens when the user changes their password.