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

@@ -3,11 +3,15 @@ from flask import (
url_for,
session,
flash,
render_template)
render_template
)
from notifications_python_client.errors import HTTPError
from app.main import main
from app.main.dao.services_dao import get_service_by_id_or_404
from app import (
invite_api_client,
user_api_client
@@ -32,7 +36,11 @@ def accept_invite(token):
session['invited_user'] = invited_user.serialize()
existing_user = user_api_client.get_user_by_email(invited_user.email_address)
try:
existing_user = user_api_client.get_user_by_email(invited_user.email_address)
except HTTPError as ex:
if ex.status_code == 404:
existing_user = False
service_users = user_api_client.get_users_for_service(invited_user.service)