Skip to content

Commit

Permalink
feat(@desktop/keycard): keycardUid pram added to user authenticated…
Browse files Browse the repository at this point in the history
… signal
  • Loading branch information
saledjenic committed Apr 27, 2023
1 parent 0a04e1a commit 87a4300
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/app/modules/main/controller.nim
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ proc init*(self: Controller) =
let data = SharedKeycarModuleArgs(uniqueIdentifier: self.authenticateUserFlowRequestedBy,
password: args.password,
pin: args.pin,
keyUid: args.keyUid)
keyUid: args.keyUid,
keycardUid: args.keycardUid)
self.authenticateUserFlowRequestedBy = ""
self.events.emit(SIGNAL_SHARED_KEYCARD_MODULE_USER_AUTHENTICATED, data)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ proc terminateCurrentFlow*(self: Controller, lastStepInTheCurrentFlow: bool) =
self.tmpFlowData.password = exportedEncryptionPubKey
self.tmpFlowData.pin = self.getPin()
self.tmpFlowData.keyUid = flowEvent.keyUid
self.tmpFlowData.keycardUid = flowEvent.instanceUID
else:
self.tmpFlowData.password = self.getPassword()
self.tmpFlowData.keyUid = singletonInstance.userProfile.getKeyUid()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const SIGNAL_SHARED_KEYCARD_MODULE_KEYCARD_SYNC_TERMINATED* = "sharedKeycarModul
## and props there will be emitted:
## -- `uniqueIdentifier` - will be the same as one used for running authentication process
## -- in case of success of a regular user authentication `keyUid`, `password` will be sent, otherwise it will be empty
## -- in case of success of a keycard user authentication `keyUid`, `pin` and `password` will be sent, otherwise they will be empty
## -- in case of success of a keycard user authentication `keycardUid`, `keyUid`, `pin` and `password` will be sent, otherwise they will be empty
##
## TLDR: when you need to authenticate user, from the module where it's needed you have to send `SIGNAL_SHARED_KEYCARD_MODULE_AUTHENTICATE_USER`
## signal to run authentication process and connect to `SIGNAL_SHARED_KEYCARD_MODULE_USER_AUTHENTICATED` signal to get the results of it.
Expand All @@ -37,6 +37,7 @@ type
password*: string
pin*: string # this is used in case we need to run another keycard flow which requires pin, after we successfully authenticated logged in user
keyUid*: string
keycardUid*: string

type
SharedKeycarModuleFlowTerminatedArgs* = ref object of SharedKeycarModuleArgs
Expand Down

0 comments on commit 87a4300

Please # to comment.