I am having issues with a login component where I call a server function, the login is super simple like this (summary of the code:
'use client'
function LoginComponent() {
const [state, formAction] = useFormState(LoginAction, { errors: '' })
return <>
<form action={formAction}>
<!-- form here --->
</form>
</>
}
'use server'
export async function LoginAction(prevValue: any, formData: FormData) {
const authResult = await GetAuth(formData);
if (authResult.requireMFA){
redirect('/auth/verify/')
}
if (authResult.success){
redirect('/')
}
}
This is not working for me and I have seen a number of issues reported on github related to redirect , I am out of ideas but something this simple gives me so much pause about next.