I have a server action function such as:
'use server'
...
export async function continueWithEmail(formData: FormData) {
const maybeEmail = formData.get('email');
const parseResult = z.string().email().safeParse(maybeEmail);
if (!parseResult.success) {
return parseResult.error.format();
}
const email = parseResult.data;
const result = await authClient.magicLinks.email.discovery.send({
email_address: email,
}); // 3rd party SDK
console.log('email resultId: ', result.response.request_id);
return redirect('/signup/continue-with-email/success');
}
that seems to be caching the call to authClient.magicLinks.email.discovery.send (this is probably using fetch behind the scenes but this is an SDK so I have no control over that fetch).
the console.log with the request_id is always the same, which indicates that that call is being cached.
how do I disable caching in this server action?
I already tried things like export const revalidate = 0 but nextjs complains that I can only export async functions from a server action file.
any ideas? 🙏
thanks!