Skip to content

Commit 4af9cd9

Browse files
feat(@desktop/biometrics): Added flow for the biometrics to work on password
screen all over the app
1 parent ed7b8d6 commit 4af9cd9

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/app/global/user_profile.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ QtObject:
6161
read = getIsKeycardUser
6262

6363
proc getUsingBiometricLogin*(self: UserProfile): bool {.slot.} =
64-
if(not main_constants.IS_MACOS):
64+
if(not main_constants.SUPPORTS_FINGERPRINT):
6565
return false
6666
return self.localAccountSettings.getStoreToKeychainValue() == LS_VALUE_STORE
6767
QtProperty[bool] usingBiometricLogin:

src/app/modules/main/profile_section/privacy/controller.nim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ proc getPasswordStrengthScore*(self: Controller, password, userName: string): in
112112
proc storeToKeychain*(self: Controller, data: string) =
113113
let myKeyUid = singletonInstance.userProfile.getKeyUid()
114114
let value = singletonInstance.localAccountSettings.getStoreToKeychainValue()
115-
if not main_constants.SUPPORTS_FINGERPRINT or # Dealing with Keychain is the MacOS only feature
115+
if not main_constants.SUPPORTS_FINGERPRINT or # Dealing with Keychain is the MacOS/iOS/Android feature
116116
data.len == 0 or
117117
value == LS_VALUE_STORE or
118118
myKeyUid.len == 0:
@@ -123,7 +123,7 @@ proc storeToKeychain*(self: Controller, data: string) =
123123

124124
proc removeFromKeychain*(self: Controller, key: string) =
125125
let value = singletonInstance.localAccountSettings.getStoreToKeychainValue()
126-
if not main_constants.IS_MACOS or # Dealing with Keychain is the MacOS only feature
126+
if not main_constants.SUPPORTS_FINGERPRINT or # Dealing with Keychain is the MacOS/iOS/Android feature
127127
key.len == 0 or
128128
value != LS_VALUE_STORE:
129129
self.delegate.onStoreToKeychainError("", "")
@@ -135,4 +135,4 @@ proc authenticateLoggedInUser*(self: Controller) =
135135
var data = SharedKeycarModuleAuthenticationArgs(uniqueIdentifier: UNIQUE_PRIVACY_SECTION_MODULE_AUTH_IDENTIFIER)
136136
if singletonInstance.userProfile.getIsKeycardUser():
137137
data.keyUid = singletonInstance.userProfile.getKeyUid()
138-
self.events.emit(SIGNAL_SHARED_KEYCARD_MODULE_AUTHENTICATE_USER, data)
138+
self.events.emit(SIGNAL_SHARED_KEYCARD_MODULE_AUTHENTICATE_USER, data)

src/constants.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ include env_cli_vars
44
## on other platform if we just change the value here
55
const IS_MACOS* = defined(macosx)
66
const IS_INTEL* = defined(amd64)
7+
const IS_MOBILE* = defined(ios) or defined(android)
78
# For future supporting fingerprints on other platforms
8-
const SUPPORTS_FINGERPRINT* = IS_MACOS
9+
const SUPPORTS_FINGERPRINT* = IS_MACOS or IS_MOBILE
910
# This is changed during compilation by reading the VERSION file
1011
const DESKTOP_VERSION {.strdefine.} = "0.0.0"
1112
const STATUSGO_VERSION* {.strdefine.} = "0.0.0"

0 commit comments

Comments
 (0)