|
|
|
@ -581,9 +581,18 @@ class TrustedCoinPlugin(BasePlugin): |
|
|
|
def do_auth(self, wizard, short_id, otp, xpub3): |
|
|
|
def do_auth(self, wizard, short_id, otp, xpub3): |
|
|
|
try: |
|
|
|
try: |
|
|
|
server.auth(short_id, otp) |
|
|
|
server.auth(short_id, otp) |
|
|
|
|
|
|
|
except TrustedCoinException as e: |
|
|
|
|
|
|
|
if e.status_code == 400: # invalid OTP |
|
|
|
|
|
|
|
wizard.show_message(_('Invalid one-time password.')) |
|
|
|
|
|
|
|
# ask again for otp |
|
|
|
|
|
|
|
self.request_otp_dialog(wizard, short_id, None, xpub3) |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
wizard.show_message(str(e)) |
|
|
|
|
|
|
|
wizard.terminate() |
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
|
wizard.show_message(str(e)) |
|
|
|
wizard.show_message(str(e)) |
|
|
|
return |
|
|
|
wizard.terminate() |
|
|
|
|
|
|
|
else: |
|
|
|
k3 = keystore.from_xpub(xpub3) |
|
|
|
k3 = keystore.from_xpub(xpub3) |
|
|
|
wizard.storage.put('x3/', k3.dump()) |
|
|
|
wizard.storage.put('x3/', k3.dump()) |
|
|
|
wizard.storage.put('use_trustedcoin', True) |
|
|
|
wizard.storage.put('use_trustedcoin', True) |
|
|
|
|