From 0169c6d5d0a1c24f013d20c3ccb4bc8d172fb4bf Mon Sep 17 00:00:00 2001 From: GareArc Date: Fri, 27 Dec 2024 13:18:23 -0500 Subject: [PATCH] fix: use only numbers for verification code --- api/services/account_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/services/account_service.py b/api/services/account_service.py index 35bd0ed58e22ec..64477480dbea91 100644 --- a/api/services/account_service.py +++ b/api/services/account_service.py @@ -17,7 +17,7 @@ from events.tenant_event import tenant_was_created from extensions.ext_database import db from extensions.ext_redis import redis_client -from libs.helper import RateLimiter, TokenManager, generate_string +from libs.helper import RateLimiter, TokenManager from libs.passport import PassportService from libs.password import compare_password, hash_password, valid_password from libs.rsa import generate_key_pair @@ -257,7 +257,7 @@ def create_account_and_tenant( @staticmethod def generate_account_deletion_verification_code(account: Account) -> tuple[str, str]: - code = generate_string(6) + code = "".join([str(random.randint(0, 9)) for _ in range(6)]) token = TokenManager.generate_token( account=account, token_type="account_deletion", additional_data={"code": code} )