better separation between api and frontend login

This commit is contained in:
2019-04-02 10:47:53 +02:00
parent ed57dc2720
commit 024f063bea
7 changed files with 80 additions and 14 deletions

View File

@@ -1,5 +1,7 @@
# Route for handling the login page logic
from flask import request, redirect, render_template, url_for
from flask_login import login_user
from backend.auth import auth_bp
@@ -10,5 +12,9 @@ def base_login():
if request.form['username'] != 'admin' or request.form['password'] != 'admin':
error = 'Invalid Credentials. Please try again.'
else:
login_user()
return redirect("/")
return render_template('login.html', error=error)