mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 10:28:41 -04:00
109526520: Implememt verify post method.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from app.main import main
|
||||
from flask import render_template, redirect, jsonify
|
||||
from flask import render_template, redirect, jsonify, session
|
||||
|
||||
from app.main.encryption import checkpw
|
||||
from app.main.forms import VerifyForm
|
||||
|
||||
|
||||
@@ -14,6 +15,15 @@ def process_verify():
|
||||
form = VerifyForm()
|
||||
|
||||
if form.validate_on_submit():
|
||||
return redirect('/add-service')
|
||||
valid_sms = checkpw(form.sms_code.data, session['sms_code'])
|
||||
valid_email = checkpw(form.email_code.data, session['email_code'])
|
||||
if valid_sms == False:
|
||||
return jsonify(sms_code='invalid'), 400
|
||||
if valid_email == False:
|
||||
return jsonify(email_code='invalid'), 400
|
||||
else:
|
||||
return jsonify(form.errors), 400
|
||||
|
||||
return redirect('/add-service')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user