New Year revamp #40
@ -3,6 +3,7 @@ import logging
|
|||||||
from flask import (
|
from flask import (
|
||||||
Blueprint,
|
Blueprint,
|
||||||
current_app,
|
current_app,
|
||||||
|
g,
|
||||||
redirect,
|
redirect,
|
||||||
render_template,
|
render_template,
|
||||||
request,
|
request,
|
||||||
@ -27,7 +28,11 @@ login_page = Blueprint('login', __name__)
|
|||||||
# Index
|
# Index
|
||||||
@login_page.route('/login', methods=['GET'])
|
@login_page.route('/login', methods=['GET'])
|
||||||
@exception_handler(__file__)
|
@exception_handler(__file__)
|
||||||
def login() -> str:
|
def login() -> str | Response:
|
||||||
|
# Do not log if logged in
|
||||||
|
if g.login.is_authenticated():
|
||||||
|
return redirect(url_for('index.index'))
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
'login.html',
|
'login.html',
|
||||||
next=request.args.get('next'),
|
next=request.args.get('next'),
|
||||||
|
Loading…
Reference in New Issue
Block a user