diff --git a/src/status_im/accounts/handlers.cljs b/src/status_im/accounts/handlers.cljs index fc4d12aa9b..11dd70a001 100644 --- a/src/status_im/accounts/handlers.cljs +++ b/src/status_im/accounts/handlers.cljs @@ -35,6 +35,7 @@ (let [data (json->clj result) public-key (:pubkey data) address (:address data) + mnemonic (:mnemonic data) account {:public-key public-key :address address :name address @@ -43,7 +44,8 @@ (when (not (str/blank? public-key)) (do (dispatch-sync [:add-account account]) - (dispatch [:login-account address password]))))) + (dispatch-sync [:save-password password mnemonic]) + (dispatch-sync [:login-account address password]))))) (register-handler :create-account diff --git a/src/status_im/chat/handlers.cljs b/src/status_im/chat/handlers.cljs index d8334e0e13..72bb0f062a 100644 --- a/src/status_im/chat/handlers.cljs +++ b/src/status_im/chat/handlers.cljs @@ -163,9 +163,8 @@ (sign-up-service/init db))) (register-handler :save-password - (fn [db [_ password]] - (sign-up-service/save-password password) - (dispatch [:create-account password]) + (fn [db [_ password mnemonic]] + (sign-up-service/save-password password mnemonic) (assoc db :password-saved true))) (register-handler :sign-up diff --git a/src/status_im/chat/sign_up.cljs b/src/status_im/chat/sign_up.cljs index 6f42aafaca..7830aaf48b 100644 --- a/src/status_im/chat/sign_up.cljs +++ b/src/status_im/chat/sign_up.cljs @@ -94,7 +94,7 @@ (on-sign-up-response (label :t/incorrect-code))))) ;; -- Saving password ---------------------------------------- -(defn save-password [password] +(defn save-password [password mnemonic] ;; TODO validate and save password (dispatch [:received-message {:msg-id (random/id) @@ -120,17 +120,14 @@ :from "console" :to "me" :new? false}]) - ;; TODO generate passphrase - (let [passphrase (str "The brash businessman's braggadocio and public squabbing with " - "candidates in the US presidential election")] - (dispatch [:received-message - {:msg-id (random/id) - :content passphrase - :content-type text-content-type - :outgoing false - :from "console" - :to "me" - :new? false}])) + (dispatch [:received-message + {:msg-id (random/id) + :content mnemonic + :content-type text-content-type + :outgoing false + :from "console" + :to "me" + :new? false}]) (dispatch [:received-message {:msg-id "8" :content (label :t/written-down) diff --git a/src/status_im/commands/handlers/jail.cljs b/src/status_im/commands/handlers/jail.cljs index a042ca0b79..1b485f0f60 100644 --- a/src/status_im/commands/handlers/jail.cljs +++ b/src/status_im/commands/handlers/jail.cljs @@ -20,7 +20,7 @@ (def console-events {:save-password (fn [[parameter]] - (dispatch [:save-password parameter])) + (dispatch [:create-account parameter])) :sign-up (fn [[parameter]] (dispatch [:sign-up parameter])) :confirm-sign-up (fn [[parameter]]