mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-13 18:25:45 +00:00
[#10141] Unable to login to multiaccount if it is already restored as account in another multiaccount (IOS)
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
parent
3cf282e75a
commit
b8861c6c14
@ -52,22 +52,27 @@
|
|||||||
{:events [::store-multiaccount-success]
|
{:events [::store-multiaccount-success]
|
||||||
:interceptors [(re-frame/inject-cofx :random-guid-generator)
|
:interceptors [(re-frame/inject-cofx :random-guid-generator)
|
||||||
(re-frame/inject-cofx ::multiaccounts.create/get-signing-phrase)]}
|
(re-frame/inject-cofx ::multiaccounts.create/get-signing-phrase)]}
|
||||||
[{:keys [db] :as cofx} password]
|
[{:keys [db] :as cofx} result password]
|
||||||
(let [{:keys [key-uid] :as multiaccount} (get-in db [:intro-wizard :root-key])
|
(let [{:keys [error]} (types/json->clj result)]
|
||||||
keycard-multiaccount? (boolean (get-in db [:multiaccounts/multiaccounts key-uid :keycard-pairing]))]
|
(if error
|
||||||
(if keycard-multiaccount?
|
{:utils/show-popup {:title (i18n/label :t/multiaccount-exists-title)
|
||||||
;; trying to recover multiaccount created with keycard
|
:content (i18n/label :t/multiaccount-exists-title)
|
||||||
{:db (-> db
|
:on-dismiss #(re-frame/dispatch [:navigate-to :multiaccounts])}}
|
||||||
(update :intro-wizard assoc
|
(let [{:keys [key-uid] :as multiaccount} (get-in db [:intro-wizard :root-key])
|
||||||
:processing? false
|
keycard-multiaccount? (boolean (get-in db [:multiaccounts/multiaccounts key-uid :keycard-pairing]))]
|
||||||
:passphrase-error :recover-keycard-multiaccount-not-supported)
|
(if keycard-multiaccount?
|
||||||
(update :intro-wizard dissoc
|
;; trying to recover multiaccount created with keycard
|
||||||
:passphrase-valid?))}
|
{:db (-> db
|
||||||
(let [multiaccount (assoc multiaccount :derived (get-in db [:intro-wizard :derived]))]
|
(update :intro-wizard assoc
|
||||||
(multiaccounts.create/on-multiaccount-created cofx
|
:processing? false
|
||||||
multiaccount
|
:passphrase-error :recover-keycard-multiaccount-not-supported)
|
||||||
password
|
(update :intro-wizard dissoc
|
||||||
{})))))
|
:passphrase-valid?))}
|
||||||
|
(let [multiaccount (assoc multiaccount :derived (get-in db [:intro-wizard :derived]))]
|
||||||
|
(multiaccounts.create/on-multiaccount-created cofx
|
||||||
|
multiaccount
|
||||||
|
password
|
||||||
|
{})))))))
|
||||||
|
|
||||||
(fx/defn store-multiaccount
|
(fx/defn store-multiaccount
|
||||||
{:events [::recover-multiaccount-confirmed]}
|
{:events [::recover-multiaccount-confirmed]}
|
||||||
@ -75,7 +80,7 @@
|
|||||||
(let [password (get-in db [:intro-wizard :key-code])
|
(let [password (get-in db [:intro-wizard :key-code])
|
||||||
{:keys [root-key]} (:intro-wizard db)
|
{:keys [root-key]} (:intro-wizard db)
|
||||||
{:keys [id]} root-key
|
{:keys [id]} root-key
|
||||||
callback #(re-frame/dispatch [::store-multiaccount-success password])
|
callback #(re-frame/dispatch [::store-multiaccount-success % password])
|
||||||
hashed-password (ethereum/sha3 (security/safe-unmask-data password))]
|
hashed-password (ethereum/sha3 (security/safe-unmask-data password))]
|
||||||
{:db (assoc-in db [:intro-wizard :processing?] true)
|
{:db (assoc-in db [:intro-wizard :processing?] true)
|
||||||
::multiaccounts.create/store-multiaccount [id hashed-password callback]}))
|
::multiaccounts.create/store-multiaccount [id hashed-password callback]}))
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
|
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
|
||||||
"owner": "status-im",
|
"owner": "status-im",
|
||||||
"repo": "status-go",
|
"repo": "status-go",
|
||||||
"version": "v0.48.8",
|
"version": "v0.49.0",
|
||||||
"commit-sha1": "d1beb4c76d9fabcd00da75ad63430104f92c1404",
|
"commit-sha1": "d7bb02540a4356fb507a08ed73491c659b076fb1",
|
||||||
"src-sha256": "0sx85hg5c1dap2cnf44kqgp0lbknl4wd3n47cchiivnlmv4c9gw8"
|
"src-sha256": "0i6s085qq67aiyzjs2lrjfnaqvbh1v1jxdsi84c176y150lwb8lw"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user