Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prep for ui email verification and legacy acct support #118

Merged

Conversation

AmandaBirmingham
Copy link
Collaborator

While implementing the client changes for requiring email verification and letting users claim legacy accounts, I ran across a couple of things that I wanted/needed to change. First of all, although AuthRocket's documentation said they will send back a claim named 'email_verification', actually they send back one called 'email_verified' ... ok. Second, in the interface code it is convenient to have the interface for finding a legacy account (by email) be of the same structure as the interface for finding an account by login info; therefore, I modified POST /accounts/legacies to return an array--empty if it found (and claimed) no legacy account, filled with a single account if it did find and claim one. Just as for find_accounts_for_login, the api structure supports returning more than one account, but the underlying code in implementation.py is not actually capable of returning more than one account at a time.

Copy link
Member

@wasade wasade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question to verify the 404 -> 200. Otherwise am 👍

@@ -89,9 +89,9 @@ def claim_legacy_acct(token_info):
t.commit()

if acct is None:
return jsonify(code=404, message=ACCT_NOT_FOUND_MSG), 404
return jsonify([]), 200
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure, this is supposed to switch from 404 -> 200?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wasade Thanks for the check, and yes, it is intentional. I agree it feels a bit odd, but basically the change in messaging is from "I looked for a particular account and failed to find it (404)" to "I successfully searched for accounts and here is a list of all the ones I found (200)", even when when the list is empty because I found no accounts. This matches the idiom of find_accounts_for_login, which also considers success to mean "I searched successfully", not necessarily "I found something" :)

@wasade
Copy link
Member

wasade commented Apr 23, 2020

Thanks!!

@wasade wasade merged commit 25c6924 into minimalInterface Apr 23, 2020
@AmandaBirmingham AmandaBirmingham deleted the prep_for_UI_email_verification_and_legacy_acct_support branch May 15, 2020 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants