Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3261790
D6503.id21813.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D6503.id21813.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D6503: [web] Allow user to `cancelSIWEAuthFlow` from `SIWELoginForm`
Attached
Detach File
Event Timeline
Log In to Comment