From 6bf9a15396cd779acdfabdbc82a9c1366c0f4546 Mon Sep 17 00:00:00 2001 From: Ayoub Abidi Date: Tue, 10 Oct 2023 13:01:19 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=92=EF=B8=8F=20fix:=20fix=20crypting?= =?UTF-8?q?=20algorithm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/security.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/security.py b/src/utils/security.py index 1b8a608..0791f56 100644 --- a/src/utils/security.py +++ b/src/utils/security.py @@ -10,7 +10,9 @@ from database.postgres_db import SessionLocal from constants.regex import email_regex, password_regex -pwd_context = CryptContext(schemes=["sha256_crypt"], deprecated="auto") +crypting_algorithm = "sha256_crypt" if JWT_ALGORITHM == "HS256" else "bcrypt" + +pwd_context = CryptContext(schemes=[crypting_algorithm], deprecated="auto") db = SessionLocal() def create_admin_user():