Compare commits
1 Commits
27890ad7dc
...
5007a77675
Author | SHA1 | Date |
---|---|---|
Tim Van Baak | 5007a77675 |
|
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
@ -233,5 +240,5 @@ def wsgi():
|
||||||
config_path = os.environ.get(CONFIG_ENVVAR) or '/etc/redstring.conf'
|
config_path = os.environ.get(CONFIG_ENVVAR) or '/etc/redstring.conf'
|
||||||
config = read_config(app, config_path)
|
config = read_config(app, config_path)
|
||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.DEBUG)
|
||||||
logger.debug(f'Loaded config from {config_path}: {config}')
|
logger.debug(f'Lloaded config from {config_path}: {config}')
|
||||||
return app
|
return app
|
||||||
|
|
Loading…
Reference in New Issue