mirror of
https://github.com/mozilla-services/syncserver
synced 2024-10-30 09:20:32 +00:00
Merge pull request #212 from mozilla-services/delete-data-with-totp
Make the data-deletion script work for accounts with TOTP enabled.
This commit is contained in:
commit
e1aab54cbc
@ -53,12 +53,16 @@ def main(argv):
|
||||
# TODO: this won't work if the user has enabled two-step auth.
|
||||
status = s.get_email_status()
|
||||
if not status["sessionVerified"]:
|
||||
code = raw_input("Enter verification link or code: ")
|
||||
if "?" in code:
|
||||
# They copy-pasted the full URL.
|
||||
code_url = urlparse.urlparse(code)
|
||||
code = urlparse.parse_qs(code_url.query)["code"][0]
|
||||
s.verify_email_code(code)
|
||||
if s.verificationMethod == "totp-2fa":
|
||||
code = raw_input("Enter TOTP code: ")
|
||||
s.totp_verify(code)
|
||||
else:
|
||||
code = raw_input("Enter verification link or code received via email: ")
|
||||
if "?" in code:
|
||||
# They copy-pasted the full URL.
|
||||
code_url = urlparse.urlparse(code)
|
||||
code = urlparse.parse_qs(code_url.query)["code"][0]
|
||||
s.verify_email_code(code)
|
||||
|
||||
# Prepare authentication details for tokenserver.
|
||||
(_, kB) = s.fetch_keys()
|
||||
|
Loading…
Reference in New Issue
Block a user