Fix the login view when no next page is provided

master
kaiyou 7 years ago
parent def0a8b89d
commit e85eada522

@ -20,7 +20,7 @@ def login():
user = models.User.login(form.email.data, form.pw.data) user = models.User.login(form.email.data, form.pw.data)
if user: if user:
flask_login.login_user(user) flask_login.login_user(user)
endpoint = flask.request.args.get('next') endpoint = flask.request.args.get('next', '.index')
return flask.redirect(flask.url_for(endpoint) return flask.redirect(flask.url_for(endpoint)
or flask.url_for('.index')) or flask.url_for('.index'))
else: else:

Loading…
Cancel
Save