From 453801f2e9459ebe0d6e9d27d5c62c730f51e2ba Mon Sep 17 00:00:00 2001 From: Anton Kamalov Date: Tue, 3 Dec 2024 17:44:23 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=81=D0=BE=D0=B4=D0=B5=D1=80=D0=B6=D0=B8=D0=BC?= =?UTF-8?q?=D0=BE=D0=B3=D0=BE=20=D1=81=D0=B5=D1=81=D1=81=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D0=B0=D0=B2=D1=82=D0=BE=D1=80=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Auth/__init__.py | 1 + App/Auth/sql/auth.sql | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/App/Auth/__init__.py b/App/Auth/__init__.py index 3e426da..402607f 100644 --- a/App/Auth/__init__.py +++ b/App/Auth/__init__.py @@ -12,6 +12,7 @@ def auth(): auth_data = auth_model(data) if auth_data.status: session.update({ + 'user_id': auth_data.result[0]['user_ID'], 'login': auth_data.result[0]['login'], 'access_user': data['access'], 'role': auth_data.result[0]['user_role'], diff --git a/App/Auth/sql/auth.sql b/App/Auth/sql/auth.sql index 4fb90bf..56c956a 100644 --- a/App/Auth/sql/auth.sql +++ b/App/Auth/sql/auth.sql @@ -1,4 +1,4 @@ -SELECT login, user_role FROM $access +SELECT user_ID, login, user_role FROM $access WHERE login = '$login' AND password = '$password' LIMIT 1; \ No newline at end of file