I get a warning in my terminal telling me to add a method="post" field to my <form> component when I use the code from the qwik/auth documentation. When I add method="POST" to the <Form> I get a type error... ):
Does anyone know how I can fix this?
The warning:
Seems like you are submitting a Qwik Action via GET request. Qwik Actions should be submitted via POST request.
Make sure your <form> has method="POST" attribute, like this: <form method="POST">
With this code
// page
const SomePage = component$(() => {
return (
<>
<SignInButton />
</>
);
});
// component
const SignInButton = component$(() => {
const signIn = useAuthSignin();
return (
<>
<Form action={signIn}>
<button>
Sign in
</button>
</Form>
</>
);
});
The typeError code: notice the method='post' in the <Form>
// page
const SomePage = component$(() => {
return (
<>
<SignInButton />
</>
);
});
// component
const SignInButton = component$(() => {
const signIn = useAuthSignin();
return (
<>
<Form action={signIn} method="POST">
<button>
Sign in
</button>
</Form>
</>
);
});