From 99ac93db4ba5b2faa639accba247181934f0c4f0 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Thu, 5 Jan 2023 11:09:14 +0100 Subject: [PATCH] Account: organize allauth settings - 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. --- readthedocs/settings/base.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/readthedocs/settings/base.py b/readthedocs/settings/base.py index 7fcdc108c10..8eb282f9fbe 100644 --- a/readthedocs/settings/base.py +++ b/readthedocs/settings/base.py @@ -701,11 +701,16 @@ def DOCKER_LIMITS(self): # All auth ACCOUNT_ADAPTER = 'readthedocs.core.adapters.AccountAdapter' ACCOUNT_EMAIL_REQUIRED = True + + # Make email verification mandatory. + # Users won't be able to login until they verify the email address. ACCOUNT_EMAIL_VERIFICATION = 'mandatory' + ACCOUNT_AUTHENTICATION_METHOD = 'username_email' - ACCOUNT_ACTIVATION_DAYS = 7 + ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 7 SOCIALACCOUNT_AUTO_SIGNUP = False SOCIALACCOUNT_STORE_TOKENS = True + SOCIALACCOUNT_PROVIDERS = { 'github': { 'SCOPE': [