diff --git a/src/status_im/multiaccounts/login/core.cljs b/src/status_im/multiaccounts/login/core.cljs index 11c9839061..e82917cb9b 100644 --- a/src/status_im/multiaccounts/login/core.cljs +++ b/src/status_im/multiaccounts/login/core.cljs @@ -212,15 +212,12 @@ (multiaccounts/switch-preview-privacy-mode-flag)))) (defn get-new-auth-method [auth-method save-password?] - (if save-password? + (when save-password? (when-not (or (= keychain/auth-method-biometric auth-method) (= keychain/auth-method-password auth-method)) (if (= auth-method keychain/auth-method-biometric-prepare) keychain/auth-method-biometric - keychain/auth-method-password)) - (when (and auth-method - (not= auth-method keychain/auth-method-none)) - keychain/auth-method-none))) + keychain/auth-method-password)))) (fx/defn login-only-events [{:keys [db] :as cofx} key-uid password save-password?] @@ -393,7 +390,8 @@ (fx/defn biometric-auth-done {:events [:biometric-auth-done]} [{:keys [db] :as cofx} {:keys [bioauth-success bioauth-message bioauth-code]}] - (let [key-uid (get-in db [:multiaccounts/login :key-uid])] + (let [key-uid (get-in db [:multiaccounts/login :key-uid]) + auth-method (get db :auth-method)] (log/debug "[biometric] biometric-auth-done" "bioauth-success" bioauth-success "bioauth-message" bioauth-message @@ -401,9 +399,12 @@ (if bioauth-success (get-credentials cofx key-uid) (fx/merge cofx - {:db (assoc-in db [:multiaccounts/login :save-password?] false)} + {:db (assoc-in db + [:multiaccounts/login :save-password?] + (= auth-method keychain/auth-method-biometric))} + (when-not (= auth-method keychain/auth-method-biometric) + (keychain/save-auth-method key-uid keychain/auth-method-none)) (biometric/show-message bioauth-message bioauth-code) - (keychain/save-auth-method key-uid keychain/auth-method-none) (open-login-callback nil))))) (fx/defn save-password diff --git a/src/status_im/ui/screens/multiaccounts/login/views.cljs b/src/status_im/ui/screens/multiaccounts/login/views.cljs index 4a7aa7091e..ec146695a1 100644 --- a/src/status_im/ui/screens/multiaccounts/login/views.cljs +++ b/src/status_im/ui/screens/multiaccounts/login/views.cljs @@ -54,7 +54,8 @@ supported-biometric-auth [:supported-biometric-auth]] [react/keyboard-avoiding-view {:style ast/multiaccounts-view} [login-toolbar can-navigate-back?] - [react/scroll-view styles/login-view + [react/scroll-view {:keyboardShouldPersistTaps :always + :style styles/login-view} [react/view styles/login-badge-container [multiaccount-login-badge multiaccount] [react/view {:style styles/password-container @@ -72,7 +73,7 @@ (re-frame/dispatch [:set-in [:multiaccounts/login :password] (security/mask-data %)]) (re-frame/dispatch [:set-in [:multiaccounts/login :error] ""])) - :secure-text-entry true + :secure-text-entry true :error (when (not-empty error) error)}]] (when (and supported-biometric-auth (= auth-method "biometric")) [react/touchable-highlight {:on-press #(re-frame/dispatch [:biometric-authenticate])} @@ -106,9 +107,9 @@ (react/dismiss-keyboard!) (re-frame/dispatch [:multiaccounts.recover.ui/recover-multiaccount-button-pressed]))}] [components.common/button - {:label (i18n/label :t/submit) + {:label (i18n/label :t/submit) :button-style styles/bottom-button - :label-style {:color (if (or (not sign-in-enabled?) processing) colors/gray colors/blue)} - :background? true - :disabled? (or (not sign-in-enabled?) processing) - :on-press #(login-multiaccount @password-text-input)}]]])) + :label-style {:color (if (or (not sign-in-enabled?) processing) colors/gray colors/blue)} + :background? true + :disabled? (or (not sign-in-enabled?) processing) + :on-press #(login-multiaccount @password-text-input)}]]]))