Changed registration flow to first send email verification link that

when visited sends sms code for second step of account verification.

At that second step user enters just sms code sent to users mobile
number.

Also moved dao calls that simply proxied calls to client to calling
client directly.

There is still a place where a user will be a sent a code for
verification to their email namely if they update email address.
This commit is contained in:
Adam Shimali
2016-03-17 13:07:52 +00:00
parent dcc253bf61
commit 2792bece54
23 changed files with 363 additions and 481 deletions

View File

@@ -1,16 +1,35 @@
from flask import (
request, render_template, redirect, url_for, session)
request,
render_template,
redirect,
url_for,
session
)
from flask.ext.login import current_user
from flask_login import login_required
from app.main import main
from app.main.dao.users_dao import (
verify_password, update_user, check_verify_code, is_email_unique,
send_verify_code)
from app.main.forms import (
ChangePasswordForm, ChangeNameForm, ChangeEmailForm, ConfirmEmailForm,
ChangeMobileNumberForm, ConfirmMobileNumberForm, ConfirmPasswordForm
verify_password,
update_user,
check_verify_code,
is_email_unique,
send_verify_code
)
from app.main.forms import (
ChangePasswordForm,
ChangeNameForm,
ChangeEmailForm,
ConfirmEmailForm,
ChangeMobileNumberForm,
ConfirmMobileNumberForm,
ConfirmPasswordForm
)
from app import user_api_client
NEW_EMAIL = 'new-email'
NEW_MOBILE = 'new-mob'
NEW_EMAIL_PASSWORD_CONFIRMED = 'new-email-password-confirmed'
@@ -63,7 +82,6 @@ def user_profile_email():
@main.route("/user-profile/email/authenticate", methods=['GET', 'POST'])
@login_required
def user_profile_email_authenticate():
# Validate password for form
def _check_password(pwd):
return verify_password(current_user.id, pwd)