added a lot of auth code
This commit is contained in:
14
auth/basic_auth.py
Normal file
14
auth/basic_auth.py
Normal 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)
|
||||
Reference in New Issue
Block a user