mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Merge pull request #26 from alphagov/persis_verify_codes
Persis verify codes
This commit is contained in:
@@ -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 VerifyForm
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ def process_verify():
|
||||
form = VerifyForm()
|
||||
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='email')
|
||||
verify_codes_dao.use_code_for_user_and_type(user_id=user.id, code_type='sms')
|
||||
users_dao.activate_user(user.id)
|
||||
login_user(user)
|
||||
return redirect('/add-service')
|
||||
|
||||
Reference in New Issue
Block a user