mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 13:39:41 -04:00
109638656: Initial implementation for two-factor
This commit is contained in:
@@ -41,11 +41,6 @@ def addservice():
|
||||
return render_template('add-service.html')
|
||||
|
||||
|
||||
@main.route("/two-factor")
|
||||
def twofactor():
|
||||
return render_template('two-factor.html')
|
||||
|
||||
|
||||
@main.route("/send-sms")
|
||||
def sendsms():
|
||||
return render_template('send-sms.html')
|
||||
|
||||
19
app/main/views/two_factor.py
Normal file
19
app/main/views/two_factor.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from flask import render_template, redirect, jsonify
|
||||
|
||||
from app.main import main
|
||||
from app.main.forms import TwoFactorForm
|
||||
|
||||
|
||||
@main.route("/two-factor", methods=['GET'])
|
||||
def render_two_factor():
|
||||
return render_template('two-factor.html', form=TwoFactorForm())
|
||||
|
||||
|
||||
@main.route('/two-factor', methods=['POST'])
|
||||
def process_two_factor():
|
||||
form = TwoFactorForm()
|
||||
|
||||
if form.validate_on_submit():
|
||||
return redirect('/dashboard')
|
||||
else:
|
||||
return jsonify(form.errors), 400
|
||||
Reference in New Issue
Block a user