Skip to content

Account: organize allauth settings #9865

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

Merged
merged 1 commit into from
Feb 28, 2023
Merged

Account: organize allauth settings #9865

merged 1 commit into from
Feb 28, 2023

Conversation

humitos
Copy link
Member

@humitos humitos commented Jan 5, 2023

  • make email verification mandatory: users without a verified email will be asked to verify their address before being able to login
  • rename ACCOUNT_ACTIVATION_DAYS since it was a setting from a Django app we don't use anymore. It's called ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS in Django Allauth.
  • email verification is not required for development instance

This PR requires other PRs to work as intended:

NOTE that I review all the settings from https://django-allauth.readthedocs.io/en/latest/configuration.html and I think we are fine moving forward with this combination.

Context: https://github.com/readthedocs/meta/discussions/103
Closes: https://github.com/readthedocs/meta/issues/104

- make email verification mandatory: users without a verified email will be
  asked to verify their address before being able to login
- rename `ACTIVATION_DAYS` since it was a setting from a Django app we don't use
  anymore. It's called EMAIL_CONFIRMATION_EXPIRE_DAYS in Django Allauth.

This PR requires other PRs in -ops to work as intended.
@humitos humitos requested a review from ericholscher January 5, 2023 10:16
@humitos humitos requested a review from a team as a code owner January 5, 2023 10:16
@ericholscher
Copy link
Member

ericholscher commented Jan 5, 2023

I wish there was a way to set this at the DB level or with a feature flag. I'm sure we could find a way to hack it, but I just assume that when we deploy this we'll have some subset of users get locked out of their accounts. Something to be on the lookout for, but I do agree it's a good default worth trying to enable.

Also asking @agjohnson to 👍 this before it goes live.

@ericholscher ericholscher requested a review from agjohnson January 5, 2023 22:35
Copy link
Contributor

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

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

Seems good enough! I also recall some issues with verification in the past but don't remember what the problem was. I'm guessing either the problem is outdated and we're fine, or we'll find out really quick why it's not mandatory.

@humitos
Copy link
Member Author

humitos commented Jan 10, 2023

I'm not merging this just yet because we talked about adding an on-site notification to all those users that don't have any email address validated and give them some weeks before deploying this change.

Next step: create a simple script to add the notification to all of them 😄

@humitos humitos added the Status: blocked Issue is blocked on another issue label Jan 10, 2023
humitos added a commit that referenced this pull request Jan 10, 2023
Add `--usernames` argument to be able to filter by usernames when sending
contacting users.

This can be used as:

```
django-admin contact_owners --notification notification.md --sticky --usernames usernames.txt
```

```
humitos
santos
anthony
```

```
Read the Docs is going to force email verification to be able to login accounts in the following weeks.
We've noticed **your account doesn't have any email verified**.
Please, go to [your email settings](/accounts/email/) and verify your email now.
```

In this case, it will send a sticky notification with that content to these 3 users.

Required by #9865
@ericholscher
Copy link
Member

I believe we have a couple scripts that already does this: https://github.com/readthedocs/readthedocs.org/blob/main/readthedocs/core/management/commands/contact_owners.py -- if it can easily be modified.

@ericholscher
Copy link
Member

Ah, I just saw the attached PR 🙃

humitos added a commit that referenced this pull request Jan 23, 2023
* Command `contact_owners`: add support to filter by usernames

Add `--usernames` argument to be able to filter by usernames when sending
contacting users.

This can be used as:

```
django-admin contact_owners --notification notification.md --sticky --usernames usernames.txt
```

```
humitos
santos
anthony
```

```
Read the Docs is going to force email verification to be able to login accounts in the following weeks.
We've noticed **your account doesn't have any email verified**.
Please, go to [your email settings](/accounts/email/) and verify your email now.
```

In this case, it will send a sticky notification with that content to these 3 users.

Required by #9865

* Lint

* Add note about how to expand use cases for this command

* Update readthedocs/core/management/commands/contact_owners.py

Co-authored-by: Santos Gallegos <[email protected]>

* Lint

Co-authored-by: Santos Gallegos <[email protected]>
@humitos humitos removed the Status: blocked Issue is blocked on another issue label Feb 28, 2023
@humitos
Copy link
Member Author

humitos commented Feb 28, 2023

We sent the on-site notification to our users and we waited 3 weeks. We are deploying these changes and making the email verification mandatory for login next week.

@humitos humitos merged commit 15a4e3a into main Feb 28, 2023
@humitos humitos deleted the humitos/verified-email branch February 28, 2023 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants