when not logged in, redirect to sign-in

parts of the initial setup/login stages were throwing 500s if user
not already in process (ie: user directly navigated to url):
* /resend-email-verification
* /text-not-received
* /send-new-code
* verify
This commit is contained in:
Leo Hemsted
2016-06-17 11:36:30 +01:00
parent 7be111d260
commit 539950d772
6 changed files with 44 additions and 16 deletions

View File

@@ -18,14 +18,14 @@ from notifications_utils.url_safe_token import check_token
from app.main import main
from app.main.forms import TwoFactorForm
from app.utils import redirect_to_sign_in
from app import user_api_client
@main.route('/verify', methods=['GET', 'POST'])
@redirect_to_sign_in
def verify():
# TODO there needs to be a way to regenerate a session id
# or handle gracefully.
user_id = session['user_details']['id']
def _check_code(code):