Make sure to reuse same client secrets between runs.

This commit is contained in:
Antoine Nguyen
2025-11-07 16:09:51 +01:00
parent 2121cfe267
commit 7a38a535f8
4 changed files with 24 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
import random
import string
import uuid
from .constants import DEFAULT_BACKUP_DIRECTORY
@@ -11,6 +12,10 @@ def make_password(length=16):
string.ascii_letters + string.digits) for _ in range(length))
def make_client_secret():
return str(uuid.uuid4())
# Validators should return a tuple bool, error message
def is_email(user_input):
"""Return True in input is a valid email"""
@@ -351,6 +356,10 @@ ConfigDictTemplate = [
"option": "move_spam_to_junk",
"default": "true",
},
{
"option": "oauth2_client_secret",
"default": make_client_secret
},
]
},
{
@@ -480,7 +489,11 @@ ConfigDictTemplate = [
{
"option": "venv_path",
"default": "%(home_dir)s/env",
}
},
{
"option": "oauth2_client_secret",
"default": make_client_secret
},
]
},
{