From 1f28f55fd05c8268e5f543dc171b22bf97531545 Mon Sep 17 00:00:00 2001 From: Anton Kamalov Date: Thu, 24 Oct 2024 00:26:16 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=BB=D1=8F=20=D0=BA=D0=BE?= =?UTF-8?q?=D1=80=D1=80=D0=B5=D0=BA=D1=82=D0=BD=D0=BE=D0=B9=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D1=8B=20=D0=B2=D1=91=D1=80=D1=81=D1=82=D0=BA?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Auth/auth.py | 2 +- App/Auth/sql/auth.sql | 2 +- App/checker.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/App/Auth/auth.py b/App/Auth/auth.py index 8178aec..5d2fb42 100644 --- a/App/Auth/auth.py +++ b/App/Auth/auth.py @@ -21,7 +21,7 @@ def auth(): auth_data = route(config, data, sql_provider, 'auth.sql') if auth_data.status: session.update({ - 'user_id': auth_data.result[0]['user_ID'], + 'login': auth_data.result[0]['login'], 'role': auth_data.result[0]['role'], 'db_config': config, 'permanent': True diff --git a/App/Auth/sql/auth.sql b/App/Auth/sql/auth.sql index c6b0820..b8f6e0b 100644 --- a/App/Auth/sql/auth.sql +++ b/App/Auth/sql/auth.sql @@ -1,4 +1,4 @@ -SELECT user_ID, role FROM user_table +SELECT login, role FROM user_table WHERE 1=1 AND login = '$login' AND password = '$password'; \ No newline at end of file diff --git a/App/checker.py b/App/checker.py index 99eb81b..0f90868 100644 --- a/App/checker.py +++ b/App/checker.py @@ -5,7 +5,7 @@ from functools import wraps def check_auth(func): @wraps(func) def wrapper(*args, **kwargs): - if 'user_id' not in session: + if 'login' not in session: return redirect(url_for('auth_bp.auth')) return func(*args, **kwargs) return wrapper \ No newline at end of file