Page MenuHomePhabricator

D12007.id40100.diff
No OneTemporary

D12007.id40100.diff

diff --git a/native/account/registration/connect-farcaster.react.js b/native/account/registration/connect-farcaster.react.js
--- a/native/account/registration/connect-farcaster.react.js
+++ b/native/account/registration/connect-farcaster.react.js
@@ -7,6 +7,7 @@
import { IdentityClientContext } from 'lib/shared/identity-client-context.js';
import { useIsAppForegrounded } from 'lib/shared/lifecycle-utils.js';
+import { siweNonceExpired } from './ethereum-utils.js';
import RegistrationButtonContainer from './registration-button-container.react.js';
import RegistrationButton from './registration-button.react.js';
import RegistrationContainer from './registration-container.react.js';
@@ -59,7 +60,16 @@
(fid?: ?string) => {
setWebViewState('closed');
- if (!skipEthereumLoginOnce || !ethereumAccount) {
+ const nonceExpired =
+ ethereumAccount && siweNonceExpired(ethereumAccount.nonceTimestamp);
+ if (nonceExpired) {
+ setCachedSelections(oldUserSelections => ({
+ ...oldUserSelections,
+ ethereumAccount: undefined,
+ }));
+ }
+
+ if (!skipEthereumLoginOnce || !ethereumAccount || nonceExpired) {
navigate<'ConnectEthereum'>({
name: ConnectEthereumRouteName,
params: {
@@ -89,6 +99,7 @@
setSkipEthereumLoginOnce,
ethereumAccount,
userSelections,
+ setCachedSelections,
],
);
diff --git a/native/account/registration/registration-types.js b/native/account/registration/registration-types.js
--- a/native/account/registration/registration-types.js
+++ b/native/account/registration/registration-types.js
@@ -53,7 +53,7 @@
+username?: string,
+password?: string,
+avatarData?: ?AvatarData,
- +ethereumAccount?: EthereumAccountSelection,
+ +ethereumAccount?: ?EthereumAccountSelection,
+farcasterID?: string,
+siweBackupSecrets?: ?SIWEBackupSecrets,
};

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 17, 9:11 AM (21 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2517765
Default Alt Text
D12007.id40100.diff (1 KB)

Event Timeline