diff options
author | romangraef <roman.graef@gmail.com> | 2018-06-02 09:58:37 +0200 |
---|---|---|
committer | romangraef <roman.graef@gmail.com> | 2018-06-02 09:58:37 +0200 |
commit | 57a8d6c5abe24324fe21da405ecdb8632cdb8b33 (patch) | |
tree | 9ab1e295efd8cbc092a7e16e60096e750fcdffbc /app.py | |
parent | 7bed1685b66f126b7130e43304ad8f53f69a3aff (diff) | |
download | my-website-57a8d6c5abe24324fe21da405ecdb8632cdb8b33.tar.gz my-website-57a8d6c5abe24324fe21da405ecdb8632cdb8b33.tar.bz2 my-website-57a8d6c5abe24324fe21da405ecdb8632cdb8b33.zip |
Added return_url to admin login
Diffstat (limited to 'app.py')
-rw-r--r-- | app.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -38,13 +38,14 @@ def inject(): return { 'projects': from_json(db.all(), List[Project]), 'empty_project': Project(), - 'admin': session.get('logged_in', False) + 'admin': session.get('logged_in', False), + 'no_login': False, } @app.route('/admin/login/', methods=['GET']) def login(): - return render_template('login.html') + return render_template('login.html', return_url=request.args.get('return_url', '/'), no_login=True) @app.route('/admin/login', methods=['POST']) @@ -52,7 +53,7 @@ def check_login(): if not check_password(request.form.get('pass')): return redirect(url_for('login')) session['logged_in'] = True - return redirect('/') + return redirect(request.args.get('return_url', '/')) @app.route('/admin/logout') |