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, };