From e307e73b0308786950ee05fcb28f18b89445bb0e Mon Sep 17 00:00:00 2001 From: Saurab-Shrestha Date: Sun, 25 Feb 2024 17:18:44 +0545 Subject: [PATCH] Updated with auth for ldap login --- private_gpt/users/api/v1/routers/auth.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/private_gpt/users/api/v1/routers/auth.py b/private_gpt/users/api/v1/routers/auth.py index 05a34e3f..e3eddf9e 100644 --- a/private_gpt/users/api/v1/routers/auth.py +++ b/private_gpt/users/api/v1/routers/auth.py @@ -127,7 +127,7 @@ def login_access_token( return True else: username, department = ldap_login(db=db, username=form_data.username, password=form_data.password) - + return True else: username, department = ldap_login(db=db, username=form_data.username, password=form_data.password) depart = crud.department.get_by_department_name(db, name=department) @@ -137,6 +137,7 @@ def login_access_token( ad_user_register(db=db, email=form_data.username, fullname=username, password=form_data.password, department_id=1) return True return False + if not (ad_auth(LDAP_ENABLE)): raise HTTPException( status_code=403,