109526036:Mark the sms code as being used on the two-factor page

This commit is contained in:
Rebecca Law
2015-12-10 16:38:34 +00:00
parent bbecc03531
commit 1ce8170ce1

View File

@@ -2,7 +2,7 @@ from flask import render_template, redirect, jsonify, session
from flask_login import login_user
from app.main import main
from app.main.dao import users_dao
from app.main.dao import users_dao, verify_codes_dao
from app.main.forms import TwoFactorForm
@@ -17,6 +17,7 @@ def process_two_factor():
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: