diff --git a/src/status_im/contexts/communities/actions/accounts_selection/effects.cljs b/src/status_im/contexts/communities/actions/accounts_selection/effects.cljs index 1d153546a0..e4486bc423 100644 --- a/src/status_im/contexts/communities/actions/accounts_selection/effects.cljs +++ b/src/status_im/contexts/communities/actions/accounts_selection/effects.cljs @@ -3,7 +3,8 @@ [promesa.core :as promesa] [schema.core :as schema] [status-im.common.json-rpc.events :as rpc] - [utils.re-frame :as rf])) + [utils.re-frame :as rf] + [utils.security.core :as security])) (defn- generate-requests-for-signing [pub-key community-id addresses-to-reveal] @@ -21,7 +22,7 @@ (fn [p-resolve p-reject] (rpc/call {:method :wakuext_signData - :params [(map #(assoc % :password password) sign-params)] + :params [(map #(assoc % :password (security/safe-unmask-data password)) sign-params)] :on-success p-resolve :on-error #(p-reject (str "failed to sign data\n" %))})))) @@ -80,7 +81,7 @@ [:cat [:map {:closed true} [:community-id string?] - [:password string?] + [:password [:maybe [:or string? object?]]] [:pub-key string?] [:addresses-to-reveal [:or [:set string?] diff --git a/src/status_im/contexts/communities/actions/accounts_selection/view.cljs b/src/status_im/contexts/communities/actions/accounts_selection/view.cljs index ee3ba17cfa..c079e9fa14 100644 --- a/src/status_im/contexts/communities/actions/accounts_selection/view.cljs +++ b/src/status_im/contexts/communities/actions/accounts_selection/view.cljs @@ -3,7 +3,6 @@ [quo.core :as quo] [react-native.core :as rn] [react-native.gesture :as gesture] - [status-im.common.password-authentication.view :as password-authentication] [status-im.contexts.communities.actions.accounts-selection.style :as style] [status-im.contexts.communities.actions.addresses-for-permissions.view :as addresses-for-permissions] [status-im.contexts.communities.actions.airdrop-addresses.view :as airdrop-addresses] @@ -58,12 +57,15 @@ (rn/use-callback (fn [] (rf/dispatch - [:password-authentication/show - {:content (fn [] [password-authentication/view])} - {:label (i18n/label :t/join-open-community) - :on-press (fn [password] - (rf/dispatch [:communities/request-to-join-with-addresses - {:community-id id :password password}]))}]) + [:standard-auth/authorize + {:auth-button-label (if can-edit-addresses? + (i18n/label :t/edit-shared-addresses) + (i18n/label :t/request-to-join)) + :on-auth-success (fn [password] + (rf/dispatch + [:communities/request-to-join-with-addresses + {:community-id id + :password password}]))}]) (navigate-back))) open-permission-sheet diff --git a/src/status_im/contexts/communities/actions/addresses_for_permissions/view.cljs b/src/status_im/contexts/communities/actions/addresses_for_permissions/view.cljs index f0090efa8d..fbdface34d 100644 --- a/src/status_im/contexts/communities/actions/addresses_for_permissions/view.cljs +++ b/src/status_im/contexts/communities/actions/addresses_for_permissions/view.cljs @@ -4,7 +4,6 @@ [quo.core :as quo] [react-native.core :as rn] [react-native.gesture :as gesture] - [status-im.common.password-authentication.view :as password-authentication] [status-im.constants :as constants] [status-im.contexts.communities.actions.addresses-for-permissions.style :as style] [status-im.contexts.communities.actions.permissions-sheet.view :as permissions-sheet] @@ -222,22 +221,22 @@ confirm-changes (fn [] (if can-edit-addresses? - (rf/dispatch - [:password-authentication/show - {:content (fn [] [password-authentication/view])} - {:label (i18n/label :t/enter-password) - :on-press (fn [password] - (rf/dispatch - [:communities/edit-shared-addresses - {:community-id id - :password password - :addresses addresses-to-reveal - :on-success (fn [] - (rf/dispatch [:dismiss-modal :addresses-for-permissions]) - (rf/dispatch [:hide-bottom-sheet]))}]))}]) (do - (rf/dispatch [:communities/set-share-all-addresses id flag-share-all-addresses]) - (rf/dispatch [:communities/set-addresses-to-reveal id addresses-to-reveal])))) + (rf/dispatch + [:standard-auth/authorize + {:auth-button-label (i18n/label :t/confirm-changes) + :on-auth-success (fn [password] + (rf/dispatch + [:communities/edit-shared-addresses + {:community-id id + :password password + :addresses addresses-to-reveal + :on-success (fn [] + (rf/dispatch [:dismiss-modal + :addresses-for-permissions]) + (rf/dispatch [:hide-bottom-sheet]))}]))}]) + (rf/dispatch [:communities/set-share-all-addresses id flag-share-all-addresses])) + (rf/dispatch [:communities/set-addresses-to-reveal id addresses-to-reveal]))) pending? (rf/sub [:communities/has-pending-request-to-join? id]) highest-role (rf/sub [:communities/highest-role-for-selection id]) [unmodified-role _] (rn/use-state highest-role)] diff --git a/src/status_im/contexts/communities/actions/airdrop_addresses/view.cljs b/src/status_im/contexts/communities/actions/airdrop_addresses/view.cljs index 93a9dd765a..034010143d 100644 --- a/src/status_im/contexts/communities/actions/airdrop_addresses/view.cljs +++ b/src/status_im/contexts/communities/actions/airdrop_addresses/view.cljs @@ -4,7 +4,6 @@ [react-native.core :as rn] [react-native.gesture :as gesture] [status-im.common.not-implemented :as not-implemented] - [status-im.common.password-authentication.view :as password-authentication] [status-im.contexts.communities.actions.airdrop-addresses.style :as style] [utils.i18n :as i18n] [utils.re-frame :as rf])) @@ -19,18 +18,20 @@ (fn [] (if can-edit-addresses? (rf/dispatch - [:password-authentication/show - {:content (fn [] [password-authentication/view])} - {:label (i18n/label :t/enter-password) - :on-press (fn [password] - (rf/dispatch - [:communities/edit-shared-addresses - {:community-id community-id - :password password - :airdrop-address address - :on-success (fn [] - (rf/dispatch [:dismiss-modal :address-for-airdrop]) - (rf/dispatch [:hide-bottom-sheet]))}]))}]) + [:standard-auth/authorize + {:auth-button-label (i18n/label :t/confirm-changes) + :on-auth-success (fn [password] + (rf/dispatch + [:communities/edit-shared-addresses + {:community-id community-id + :password password + :airdrop-address address + :on-success (fn [] + (rf/dispatch + [:dismiss-modal + :address-for-airdrop]) + (rf/dispatch + [:hide-bottom-sheet]))}]))}]) (do (rf/dispatch [:communities/set-airdrop-address community-id address]) (rf/dispatch [:hide-bottom-sheet])))))] diff --git a/src/status_im/contexts/communities/actions/request_to_join/view.cljs b/src/status_im/contexts/communities/actions/request_to_join/view.cljs index 414554377a..37abefc50c 100644 --- a/src/status_im/contexts/communities/actions/request_to_join/view.cljs +++ b/src/status_im/contexts/communities/actions/request_to_join/view.cljs @@ -5,7 +5,6 @@ [quo.theme] [react-native.core :as rn] [react-native.gesture :as gesture] - [status-im.common.password-authentication.view :as password-authentication] [status-im.contexts.communities.actions.community-rules-list.view :as community-rules] [status-im.contexts.communities.actions.request-to-join.style :as style] [utils.i18n :as i18n] @@ -13,11 +12,14 @@ (defn join-community-and-navigate-back [id] - (rf/dispatch [:password-authentication/show - {:content (fn [] [password-authentication/view])} - {:label (i18n/label :t/join-open-community) - :on-press #(rf/dispatch [:communities/request-to-join - {:community-id id :password %}])}]) + (rf/dispatch + [:standard-auth/authorize + {:auth-button-label (i18n/label :t/request-to-join) + :on-auth-success (fn [password] + (rf/dispatch + [:communities/request-to-join + {:community-id id :password password}]))}]) + (rf/dispatch [:navigate-back])) (defn- view-internal diff --git a/src/status_im/contexts/communities/overview/events.cljs b/src/status_im/contexts/communities/overview/events.cljs index 638312d315..6761a8bc6a 100644 --- a/src/status_im/contexts/communities/overview/events.cljs +++ b/src/status_im/contexts/communities/overview/events.cljs @@ -3,7 +3,8 @@ [status-im.contexts.communities.utils :as utils] [taoensso.timbre :as log] [utils.i18n :as i18n] - [utils.re-frame :as rf])) + [utils.re-frame :as rf] + [utils.security.core :as security])) (rf/reg-event-fx :communities/check-permissions-to-join-community-success (fn [{:keys [db]} [community-id based-on-client-selection? result]] @@ -89,7 +90,7 @@ (let [addresses-to-reveal (map :account sign-params)] {:fx [[:json-rpc/call [{:method "wakuext_signData" - :params [(map #(assoc % :password password) sign-params)] + :params [(map #(assoc % :password (security/safe-unmask-data password)) sign-params)] :on-success [:communities/request-to-join-with-signatures community-id addresses-to-reveal] :on-error [:communities/requested-to-join-error community-id]}]]]})) diff --git a/test/appium/views/chat_view.py b/test/appium/views/chat_view.py index c5fcadecc7..4670fe070c 100644 --- a/test/appium/views/chat_view.py +++ b/test/appium/views/chat_view.py @@ -420,8 +420,7 @@ class CommunityView(HomeView): self.join_button.wait_and_click(120) self.slide_to_request_to_join_button.swipe_right_on_element(width_percentage=16) self.password_input.send_keys(password) - Button(self.driver, - xpath="//*[@content-desc='password-input']/../following-sibling::*//*[@text='Join Community']").click() + self.login_button.click() if open_community: self.community_status_joined.wait_for_visibility_of_element(60)