summaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
authorromangraef <roman.graef@gmail.com>2018-06-02 09:58:37 +0200
committerromangraef <roman.graef@gmail.com>2018-06-02 09:58:37 +0200
commit57a8d6c5abe24324fe21da405ecdb8632cdb8b33 (patch)
tree9ab1e295efd8cbc092a7e16e60096e750fcdffbc /app.py
parent7bed1685b66f126b7130e43304ad8f53f69a3aff (diff)
downloadmy-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.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/app.py b/app.py
index ae6ec36..6b3e4da 100644
--- a/app.py
+++ b/app.py
@@ -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')