Skip to content

Commit

Permalink
[native][web] Handle use_new_flow for Identity V1 login calls
Browse files Browse the repository at this point in the history
Summary:
Address [[ https://linear.app/comm/issue/ENG-9717/support-use-new-flow-for-v1-login | ENG-9717 ]]

For V1 login we can reuse existing logic for `unsupported_version` to also work for `use_new_flow`. Desired behavior is the same.
Updated all Identity callsites.

Depends on D13954

Test Plan: Mocked local Identity to return `use_new_flow` for all login RPCs. Confirmed that login attempt on device fails and a message is displayed

Reviewers: varun, kamil

Reviewed By: kamil

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D14032
  • Loading branch information
barthap committed Nov 29, 2024
1 parent 3438b06 commit 430be00
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion native/account/fullscreen-siwe-panel.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ function FullscreenSIWEPanel(props: Props): React.Node {
onNonceExpired('login');
} else if (
messageForException === 'unsupported_version' ||
messageForException === 'client_version_unsupported'
messageForException === 'client_version_unsupported' ||
messageForException === 'use_new_flow'
) {
Alert.alert(
appOutOfDateAlertDetails.title,
Expand Down
3 changes: 2 additions & 1 deletion native/account/log-in-panel.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ class LogInPanel extends React.PureComponent<Props, State> {
);
} else if (
messageForException === 'unsupported_version' ||
messageForException === 'client_version_unsupported'
messageForException === 'client_version_unsupported' ||
messageForException === 'use_new_flow'
) {
Alert.alert(
appOutOfDateAlertDetails.title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ function ExistingEthereumAccount(props: Props): React.Node {
);
} else if (
messageForException === 'unsupported_version' ||
messageForException === 'client_version_unsupported'
messageForException === 'client_version_unsupported' ||
messageForException === 'use_new_flow'
) {
Alert.alert(
appOutOfDateAlertDetails.title,
Expand Down
3 changes: 2 additions & 1 deletion web/account/siwe-login-form.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ function SIWELoginForm(props: SIWELoginFormProps): React.Node {
setError('account_does_not_exist');
} else if (
messageForException === 'client_version_unsupported' ||
messageForException === 'unsupported_version'
messageForException === 'unsupported_version' ||
messageForException === 'use_new_flow'
) {
setError('client_version_unsupported');
} else if (messageForException === 'retry_from_native') {
Expand Down
3 changes: 2 additions & 1 deletion web/account/traditional-login-form.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ function TraditionalLoginForm(): React.Node {
setErrorMessage('incorrect username or password');
} else if (
messageForException === 'client_version_unsupported' ||
messageForException === 'unsupported_version'
messageForException === 'unsupported_version' ||
messageForException === 'use_new_flow'
) {
setErrorMessage(getShortVersionUnsupportedError());
} else if (
Expand Down

0 comments on commit 430be00

Please sign in to comment.