Update API package to fix stale session issues (#9998)

This commit is contained in:
Eric Bailey
2026-03-04 18:27:12 -06:00
committed by GitHub
parent 8446efb739
commit 7fd218c97d
8 changed files with 19 additions and 39 deletions
@@ -1,6 +1,6 @@
import {useMutation} from '@tanstack/react-query'
import {useAgent, useSession, useSessionApi} from '#/state/session'
import {useAgent, useSession} from '#/state/session'
export function useConfirmEmail({
onSuccess,
@@ -8,7 +8,6 @@ export function useConfirmEmail({
}: {onSuccess?: () => void; onError?: () => void} = {}) {
const agent = useAgent()
const {currentAccount} = useSession()
const {partialRefreshSession} = useSessionApi()
return useMutation({
mutationFn: async ({token}: {token: string}) => {
@@ -20,7 +19,8 @@ export function useConfirmEmail({
email: currentAccount.email.trim(),
token: token.trim(),
})
await partialRefreshSession()
// will update session state at root of app
await agent.resumeSession(agent.session!)
},
onSuccess,
onError,