diff --git a/src/context/session.tsx b/src/context/session.tsx index 3d7b701b..94a69ea0 100644 --- a/src/context/session.tsx +++ b/src/context/session.tsx @@ -255,13 +255,21 @@ export const SessionProvider = (props: { const requireAuthentication = async (callback: () => void, modalSource: AuthModalSource) => { setIsAuthWithCallback(() => callback) - await loadSession() - if (!session()) { - showModal('auth', modalSource) + await loadSession() + if (!session()) { + showModal('auth', modalSource) + } } } + createEffect(() => { + if (isAuthWithCallback()) { + isAuthWithCallback()() + setIsAuthWithCallback(null) + } + }) + // authorizer api proxy methods const signUp = async (params: SignupInput) => { const authResult: void | AuthToken = await authorizer().signup(params)