main: Added the post method
All checks were successful
Build Docker / Build Bot (push) Successful in 24s
Build Docker / Build Master (push) Successful in 26s

This commit is contained in:
Nathan Woodburn 2023-08-25 16:32:50 +10:00
parent 83bde4b218
commit 9e485265af
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -447,10 +447,10 @@ def home():
return html return html
# Admin page # Admin page
@app.route('/admin',) @app.route('/admin', methods=['GET', 'POST'])
def admin(): def admin():
# Check if logged in # Check if logged in
loggin_key = request.cookies.get('login_key') login_key = request.cookies.get('login_key')
if request.method == 'POST': if request.method == 'POST':
# Handle login # Handle login
@ -465,9 +465,9 @@ def admin():
return resp return resp
if loggin_key == None: if login_key == None:
return "<h1>Admin</h1><br><form action='/admin' method='POST'><input type='password' name='Master API'><input type='submit' value='Login'></form>" return "<h1>Admin</h1><br><form action='/admin' method='POST'><input type='password' name='Master API'><input type='submit' value='Login'></form>"
if loggin_key not in loggins: if login_key not in loggins:
return "<h1>Admin</h1><br><form action='/admin' method='POST'><input type='password' name='Master API'><input type='submit' value='Login'></form>" return "<h1>Admin</h1><br><form action='/admin' method='POST'><input type='password' name='Master API'><input type='submit' value='Login'></form>"
return "<h1>Admin</h1><br>Logged in" return "<h1>Admin</h1><br>Logged in"