mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 02:42:26 -05:00
Add debugging to find issue.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import traceback
|
||||
|
||||
from flask import render_template, redirect, jsonify, session
|
||||
from flask_login import login_user
|
||||
|
||||
@@ -13,12 +15,15 @@ def render_two_factor():
|
||||
|
||||
@main.route('/two-factor', methods=['POST'])
|
||||
def process_two_factor():
|
||||
form = TwoFactorForm()
|
||||
try:
|
||||
form = TwoFactorForm()
|
||||
|
||||
if form.validate_on_submit():
|
||||
user = users_dao.get_user_by_id(session['user_id'])
|
||||
verify_codes_dao.use_code_for_user_and_type(user_id=user.id, code_type='sms')
|
||||
login_user(user)
|
||||
return redirect('/dashboard')
|
||||
else:
|
||||
return jsonify(form.errors), 400
|
||||
if form.validate_on_submit():
|
||||
user = users_dao.get_user_by_id(session['user_id'])
|
||||
verify_codes_dao.use_code_for_user_and_type(user_id=user.id, code_type='sms')
|
||||
login_user(user)
|
||||
return redirect('/dashboard')
|
||||
else:
|
||||
return jsonify(form.errors), 400
|
||||
except:
|
||||
traceback.print_exc()
|
||||
Reference in New Issue
Block a user