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