Turn on redirects for new_password

This is part of the work to make sure user is redirected
to the page they initially were meant to visit after
they sign in.
This commit is contained in:
Pea Tyczynska
2020-10-09 11:40:28 +01:00
parent b0db60e417
commit 1fc2bee42d
3 changed files with 13 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ from flask import (
flash,
redirect,
render_template,
request,
session,
url_for,
)
@@ -46,6 +47,6 @@ def new_password(token):
else:
# send user a 2fa sms code
user.send_verify_code()
return redirect(url_for('main.two_factor'))
return redirect(url_for('main.two_factor', next=request.args.get('next')))
else:
return render_template('views/new-password.html', token=token, form=form, user=user)