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

20220112 email verified #591

Merged
merged 16 commits into from
Aug 13, 2022
Merged

20220112 email verified #591

merged 16 commits into from
Aug 13, 2022

Conversation

peterthomassen
Copy link
Member

No description provided.

@peterthomassen peterthomassen force-pushed the 20220112_email_verified branch 10 times, most recently from 1a11c6a to b801018 Compare January 17, 2022 14:55
@peterthomassen peterthomassen marked this pull request as ready for review January 17, 2022 14:56
@peterthomassen
Copy link
Member Author

The PR improves (hopefully) on the way authenticated actions are processed. User.is_active is now nullable, with the null value representing pending activation. Activated users have is_active = True, and locked ones have is_active = False, as before. Users which have not logged in and previously had is_active = False are pending activation (in the old scheme) and are migrated to "null".

Authenticated actions now only can be performed by active users (except account activation, which only requires that is_active != False, so null is fine). Locked users cannot perform any authenticated actions any longer.

The PR also adds User.email_verified which is set any time an auth action code is presented and passes the serializer validation. This means that the code is structurally valid and not expired (this includes cases where the action is not executed because the user is locked, but the code was otherwise valid).

We started verifying email addresses on Oct 23, 2019. Users which signed up on or after this date and have is_active = True or have logged in at least once have email_verified set to created. (The last case covers locked users, for which we set is_active = False manually at some point.)

@peterthomassen
Copy link
Member Author

rebased on top of #592, i.e. first commit doesn't actually belong to this PR

@peterthomassen peterthomassen force-pushed the 20220112_email_verified branch 2 times, most recently from b8d1489 to db4934c Compare January 19, 2022 14:50
@nils-wisiol nils-wisiol marked this pull request as draft January 19, 2022 14:58
@peterthomassen peterthomassen force-pushed the 20220112_email_verified branch 9 times, most recently from 38d1663 to 0b8315c Compare January 25, 2022 10:38
@peterthomassen peterthomassen marked this pull request as ready for review January 25, 2022 11:47
@peterthomassen peterthomassen force-pushed the 20220112_email_verified branch 4 times, most recently from f73fcae to aef7eae Compare August 11, 2022 16:09
@peterthomassen peterthomassen force-pushed the 20220112_email_verified branch 2 times, most recently from c239386 to f121ffb Compare August 11, 2022 18:23
@peterthomassen
Copy link
Member Author

Alright, this time ready for real. Did some minor tweaks here and there, added some unrelated bug fixes, and put all the commits in right order.

Copy link
Contributor

@nils-wisiol nils-wisiol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lgtm!

@nils-wisiol
Copy link
Contributor

Note the one comment above. While at it, maybe add an example for how to use this to README?

@peterthomassen peterthomassen merged commit 86a7014 into main Aug 13, 2022
@peterthomassen peterthomassen deleted the 20220112_email_verified branch August 13, 2022 22:10
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

Successfully merging this pull request may close these issues.

None yet

2 participants