Исправление для корректной работы вёрстки
This commit is contained in:
@@ -21,7 +21,7 @@ def auth():
|
|||||||
auth_data = route(config, data, sql_provider, 'auth.sql')
|
auth_data = route(config, data, sql_provider, 'auth.sql')
|
||||||
if auth_data.status:
|
if auth_data.status:
|
||||||
session.update({
|
session.update({
|
||||||
'user_id': auth_data.result[0]['user_ID'],
|
'login': auth_data.result[0]['login'],
|
||||||
'role': auth_data.result[0]['role'],
|
'role': auth_data.result[0]['role'],
|
||||||
'db_config': config,
|
'db_config': config,
|
||||||
'permanent': True
|
'permanent': True
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
SELECT user_ID, role FROM user_table
|
SELECT login, role FROM user_table
|
||||||
WHERE 1=1
|
WHERE 1=1
|
||||||
AND login = '$login'
|
AND login = '$login'
|
||||||
AND password = '$password';
|
AND password = '$password';
|
||||||
@@ -5,7 +5,7 @@ from functools import wraps
|
|||||||
def check_auth(func):
|
def check_auth(func):
|
||||||
@wraps(func)
|
@wraps(func)
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
if 'user_id' not in session:
|
if 'login' not in session:
|
||||||
return redirect(url_for('auth_bp.auth'))
|
return redirect(url_for('auth_bp.auth'))
|
||||||
return func(*args, **kwargs)
|
return func(*args, **kwargs)
|
||||||
return wrapper
|
return wrapper
|
||||||
Reference in New Issue
Block a user