Page MenuHomePhabricator

D6503.id21813.diff
No OneTemporary

D6503.id21813.diff

diff --git a/web/account/log-in-form.react.js b/web/account/log-in-form.react.js
--- a/web/account/log-in-form.react.js
+++ b/web/account/log-in-form.react.js
@@ -25,9 +25,13 @@
openConnectModal && openConnectModal();
}, [openConnectModal]);
+ const cancelSIWEAuthFlow = React.useCallback(() => {
+ setSIWEAuthFlowSelected(false);
+ }, []);
+
let siweSection;
if (isDev && siweAuthFlowSelected && signer) {
- siweSection = <SIWELoginForm />;
+ siweSection = <SIWELoginForm cancelSIWEAuthFlow={cancelSIWEAuthFlow} />;
} else if (isDev) {
siweSection = <SIWEButton onSIWEButtonClick={onSIWEButtonClick} />;
}
diff --git a/web/account/siwe-login-form.react.js b/web/account/siwe-login-form.react.js
--- a/web/account/siwe-login-form.react.js
+++ b/web/account/siwe-login-form.react.js
@@ -34,10 +34,14 @@
import { webLogInExtraInfoSelector } from '../selectors/account-selectors.js';
import css from './siwe.css';
+type SIWELoginFormProps = {
+ +cancelSIWEAuthFlow: () => void,
+};
+
const getSIWENonceLoadingStatusSelector = createLoadingStatusSelector(
getSIWENonceActionTypes,
);
-function SIWELoginForm(): React.Node {
+function SIWELoginForm(props: SIWELoginFormProps): React.Node {
const { address } = useAccount();
const { data: signer } = useSigner();
const dispatch = useDispatch();
@@ -119,6 +123,8 @@
attemptSIWEAuth(message, signature);
}, [address, attemptSIWEAuth, primaryIdentityPublicKey, signer, siweNonce]);
+ const { cancelSIWEAuthFlow } = props;
+
if (!siweNonce || !primaryIdentityPublicKey) {
return (
<div className={css.connectButtonContainer}>
@@ -142,6 +148,10 @@
<Button variant="filled" onClick={onSignInButtonClick}>
Sign in
</Button>
+ <hr />
+ <Button variant="filled" onClick={cancelSIWEAuthFlow}>
+ Go back
+ </Button>
</div>
);
}

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 16, 11:28 PM (19 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2504506
Default Alt Text
D6503.id21813.diff (1 KB)

Event Timeline