Создание отдельной страницы ошибки авторизации

This commit is contained in:
Anton Kamalov
2024-10-22 22:09:02 +03:00
parent 9f113c1603
commit e2684ed2a3
3 changed files with 14 additions and 2 deletions

View File

@@ -27,4 +27,4 @@ def auth():
})
return redirect(url_for('index'))
else:
return auth_data.error_message
return render_template('error.html', error_message=auth_data.error_message)

View File

@@ -11,5 +11,5 @@ def route(db_config, input_data, sql_provider, name) -> InfoRespronse:
print("sql = ", _sql)
result = select_list(db_config, _sql)
if result is None:
return InfoRespronse(result, error_message = 'Ошибка на этапе авторизации', status=False)
return InfoRespronse(result, error_message = 'Произошла ошибка на этапе авторизации :(', status=False)
return InfoRespronse(result, error_message='', status=True)

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Ошибка</title>
</head>
<body>
<h1>Сожалеем</h1>
<p>{{ error_message }}</p>
<p><a href="{{ url_for('auth_bp.auth') }}">Вернуться</a></p>
</body>
</html>