Skip to content

Commit

Permalink
Code review changes on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
AmandaBirmingham committed Apr 24, 2020
1 parent 5e4b836 commit d8db706
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions microsetta_private_api/example/client_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
# get the token, validate it, and pull email out of it.
def parse_jwt(token):
decoded = jwt.decode(token, PUB_KEY, algorithms=['RS256'], verify=True)
email_verified = decoded.get('email_verified') is True
email_verified = decoded.get('email_verified', False)
return decoded["email"], email_verified


Expand Down Expand Up @@ -94,7 +94,7 @@ def home():
return workflow_state["reroute"]

acct_id = workflow_state.get("account_id", None)
show_wizard = False # workflow_needs != ALL_DONE
show_wizard = False

# Note: home.jinja2 sends the user directly to authrocket to complete the
# login if they aren't logged in yet.
Expand Down Expand Up @@ -147,7 +147,7 @@ def determine_workflow_state():
current_state['account_id'] = acct_id

# If we haven't yet checked for email mismatches and gotten user decision:
if not session.get(EMAIL_CHECK_KEY):
if not session.get(EMAIL_CHECK_KEY, False):
# Does email in our accounts table match email in authrocket?
needs_reroute, email_match = ApiRequest.get(
"/accounts/%s/email_match" % acct_id)
Expand Down Expand Up @@ -282,7 +282,7 @@ def post_workflow_update_email(body):
return redirect(WORKFLOW_URL)

# if the customer wants to update their email:
update_email = int(body["do_update"]) # 0 or 1
update_email = body["do_update"] == "Yes"
if update_email:
# get the existing account object
acct_id = current_state["account_id"]
Expand Down
7 changes: 5 additions & 2 deletions microsetta_private_api/templates/home.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@
</div>
{% else %}
<p>
It appears that your email has not yet been verified. Please check your email account (and spam folder)
for a verification email and follow its instructions.
It appears that your email has not yet been verified.
Please check your email account (and spam folder) for a verification email
from "The Microsetta Initiative" and follow its instructions.
This email will come from our authentication service AuthRocket,
and use the email address "noreply@loginrocket.com".
</p>
<p>
If you cannot locate the original verification email, have it resent by
Expand Down
4 changes: 2 additions & 2 deletions microsetta_private_api/templates/update_email.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link rel="stylesheet" href="/static/css/minimal_interface.css" />
<script>
function cancelEmailUpdate(){
$('#do_update').val("0");
$('#do_update').val("No");
}
</script>
</head>
Expand All @@ -35,7 +35,7 @@
<br />
<br />
<form method="post" name="kit_claim_form" action="/workflow_update_email">
<input type="hidden" id="do_update" name = "do_update" value="1" />
<input type="hidden" id="do_update" name = "do_update" value="Yes" />
<button type="submit" class="btn btn-light" onclick="cancelEmailUpdate();">
No, skip and continue
</button>
Expand Down

0 comments on commit d8db706

Please sign in to comment.