diff --git a/redstring/server.py b/redstring/server.py index 6be5a28..b2fbe5a 100644 --- a/redstring/server.py +++ b/redstring/server.py @@ -105,9 +105,16 @@ def document(document_id): @app.route('/login/', methods=['GET', 'POST']) def login(): form = LoginForm() - if form.validate_on_submit() and check_password(current_app, form.password.data): - login_user(Admin()) - return redirect(url_for('index')) + s = form.is_submitted() + logger.debug(f's={s}') + 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)