Исправление для корректной работы вёрстки
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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';
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user