diff --git a/src/auth/index.ts b/src/auth/index.ts index 7d202414e7c..a47646a1451 100644 --- a/src/auth/index.ts +++ b/src/auth/index.ts @@ -70,9 +70,11 @@ export const authenticateWallet = async (): Promise => { const signature = await signer.signMessage(message); - await authProxyRequest('auth', { + return authProxyRequest('auth', { method: 'POST', body: JSON.stringify({ message, signature }), }); } + + return authCheck; }; diff --git a/src/components/shared/Fields/Form/ActionForm.tsx b/src/components/shared/Fields/Form/ActionForm.tsx index 26a1a7c4124..1f1b90145b7 100644 --- a/src/components/shared/Fields/Form/ActionForm.tsx +++ b/src/components/shared/Fields/Form/ActionForm.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { type FieldValues, type UseFormReturn } from 'react-hook-form'; +import { authenticateWallet } from '~auth'; import useAsyncFunction from '~hooks/useAsyncFunction.ts'; import { type ActionTypes, type ActionTypeString } from '~redux/index.ts'; import { type ActionTransformFnType, getFormAction } from '~utils/actions.ts'; @@ -66,6 +67,8 @@ const ActionForm = >({ }); const handleSubmit: CustomSubmitHandler = async (values, formHelpers) => { try { + // Force re-auth check to account for loss of auth/connection after the session has been started + await authenticateWallet(); const res = await asyncFunction(values); onSuccess?.(values, formHelpers, res); } catch (e) {