From e1a8e765ce2ba439ec69a092e29ff78f2f0abb82 Mon Sep 17 00:00:00 2001 From: Mateusz779 Date: Thu, 13 Apr 2023 11:56:36 +0200 Subject: [PATCH] - --- app.py | 8 ++++---- {template => templates}/index.html | 0 {template => templates}/login.html | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename {template => templates}/index.html (100%) rename {template => templates}/login.html (100%) diff --git a/app.py b/app.py index 9726fa8..da97c74 100644 --- a/app.py +++ b/app.py @@ -20,8 +20,8 @@ def main(): auth_token = request.cookies.get('auth_token') if auth_token != "" or auth_token is not None: if db.get_user_bytoken(auth_token) is None: - return render_template('template/login.html') - return render_template('template/index.html') + return render_template('login.html') + return render_template('index.html') @app.route('/api/login', methods=['POST']) def login_post(): @@ -31,9 +31,9 @@ def login_post(): auth_token = db.login() if auth_token is None: flash('Nieprawidłowa nazwa użytkownika lub hasło.', 'error') - return redirect(url_for('login')) + return redirect(url_for('/')) - response = make_response(render_template('template/index.html')) + response = make_response(render_template('index.html')) response.set_cookie('auth_token', auth_token) return response diff --git a/template/index.html b/templates/index.html similarity index 100% rename from template/index.html rename to templates/index.html diff --git a/template/login.html b/templates/login.html similarity index 100% rename from template/login.html rename to templates/login.html