added a lot of auth code

This commit is contained in:
2019-03-21 16:17:25 +01:00
parent bef3c6dc9b
commit 0469b8dbb5
13 changed files with 220 additions and 23 deletions

14
auth/basic_auth.py Normal file
View File

@@ -0,0 +1,14 @@
# Route for handling the login page logic
from flask import request, redirect, render_template, url_for
from backend.auth import auth_bp
@auth_bp.route('/base_login', methods=['GET', 'POST'])
def base_login():
error = None
if request.method == 'POST':
if request.form['username'] != 'admin' or request.form['password'] != 'admin':
error = 'Invalid Credentials. Please try again.'
else:
return redirect("/")
return render_template('login.html', error=error)