add authenticate

This commit is contained in:
Michele Balistreri 2021-10-06 00:50:21 +03:00 committed by Iuri Matias
parent 122314c060
commit 4aec7db317
1 changed files with 5 additions and 7 deletions

View File

@ -100,13 +100,11 @@ QtObject:
discard #display wrong pairing password message
proc authenticate*(self: KeycardView, pin: string) {.slot.} =
discard """
let resp = self.status.keycard.verifyPIN(pin)
if resp is error:
handle error
self.cardAuthenticated()
"""
try:
self.status.keycard.verifyPin(pin)
self.cardAuthenticated()
except KeycardVerifyPINException as ex:
discard #display wrong PIN message
proc init*(self: KeycardView, pin: string) {.slot.} =
discard """