From b81c6c9fa32ccda3d3a8da3098ea5ae41f6bf98b Mon Sep 17 00:00:00 2001 From: Trent Palmer Date: Wed, 18 Jun 2025 15:07:47 -0700 Subject: [PATCH] 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 --- app/auth/totp_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/auth/totp_utils.py b/app/auth/totp_utils.py index 911c20f..62a687f 100644 --- a/app/auth/totp_utils.py +++ b/app/auth/totp_utils.py @@ -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'],