update totp.py handle pyotp.random_base32() now outputs 32 char string

that won't fit into existing 16char type in the existing app database
This commit is contained in:
Trent Palmer 2025-06-18 15:07:47 -07:00
parent 0dde8781ec
commit b81c6c9fa3

View File

@ -8,7 +8,7 @@ from io import BytesIO
def get_totp_qr(contributor, app_config):
totp_key = pyotp.random_base32() if contributor.totp_key is None else contributor.totp_key
totp_key = pyotp.random_base32()[:16] if contributor.totp_key is None else contributor.totp_key
if contributor.totp_key is None:
conn = psycopg2.connect(
dbname=app_config['DATABASE_NAME'],