Add more logging

This commit is contained in:
Tim Van Baak 2021-02-18 19:17:43 -08:00
parent 6a92249ca2
commit 27890ad7dc
1 changed files with 10 additions and 3 deletions

View File

@ -105,9 +105,16 @@ def document(document_id):
@app.route('/login/', methods=['GET', 'POST']) @app.route('/login/', methods=['GET', 'POST'])
def login(): def login():
form = LoginForm() form = LoginForm()
if form.validate_on_submit() and check_password(current_app, form.password.data): s = form.is_submitted()
login_user(Admin()) logger.debug(f's={s}')
return redirect(url_for('index')) if s:
v = form.validate()
logger.debug(f'v={v}')
if v:
valid = check_password(current_app, form.password.data)
if valid:
login_user(Admin())
return redirect(url_for('index'))
return render_template('login.jinja', form=form) return render_template('login.jinja', form=form)