diff --git a/app.py b/app.py index 1889673..3b859a6 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,5 @@ -from flask import Flask, render_template, request, url_for, flash, redirect, g +import werkzeug +from flask import Flask, render_template, request, url_for, session, redirect, g, abort import sqlite3 connection = sqlite3.connect('database.db') @@ -45,7 +46,8 @@ def sql(): user = cursor.fetchone() if not user: return render_template('sql-injection.html', error='Ошибка: неверный логин или пароль') - return render_template('sql-injection.html', success="Вход произведён успешно!") + session['success_login'] = True + return redirect(url_for('success_login'), code=302) return render_template('sql-injection.html') @app.route("/found-me") @@ -56,10 +58,15 @@ def found(): def decode(): return render_template('decode.html') -@app.route("/auth-data") -def authdata(): - pass +@app.route("/success_login") +def success_login(): + if session.get('success_login'): + return render_template('success.html') + abort(404) +@app.errorhandler(werkzeug.exceptions.NotFound) +def handle_bad_request(e): + return '', 404 app.run(host="0.0.0.0", debug=False) connection.close() diff --git a/static/index.css b/static/index.css index 87171b2..0f7e8e6 100644 --- a/static/index.css +++ b/static/index.css @@ -17,6 +17,15 @@ display: none; } +.profile { + width: fit-content; + max-width: 40rem; + margin: 3.5rem 0rem; + padding: 0.7rem 2rem; + background-color: rgba(0,0,0, 0.85); + text-align: left; +} + .inpt { width: 15vw; height: 1vw; @@ -380,12 +389,6 @@ box-shadow: 0.7em 0.7em 0em 0px rgba(0, 0, 0, 0.65); } - -.hidden { - color: rgba(0,0,0,0); -} - - #success { bottom: 7%; right: 11%; diff --git a/templates/success.html b/templates/success.html new file mode 100644 index 0000000..0a5cee3 --- /dev/null +++ b/templates/success.html @@ -0,0 +1,20 @@ + + + {% include '_head.html' %} + + {% include '_header.html' %} +
+

Ваш Профиль:

+

Логин: admin

+

Почта: supercooladmin@coders-squad.com

+

О себе:

+

Я самый надёжный и крутой админ в мире.
ВЫДЕЛИ МЕНЯ!

+
+ {% include '_sidenav.html' %} +

Вход произведён успешно!

+ + + + + +