const app = useNuxtApp();
// form
interface Form {
username: string;
password: string;
returnTo?: string;
}
const form = reactive<Form>({
username: "",
password: "",
});
const submitForm = ($event: Event) => {
app.$auth.loginWith("cookie", { body: form });
...
}
but the form gets encoded as json instead.
and when using { data: form } instead of body it doesn't send any payload with the POST.
what am I doing wrong?
Hi, noob question. on the ofetch powered auth, how should
loginWith("cookie", ...args)
be used some those args getmultipart/form-data
encoded?if I understand correctly
...args
becomesendpoint
so onnuxt.config.ts
I haveand on
login.vue
but the form gets encoded as json instead. and when using
{ data: form }
instead ofbody
it doesn't send any payload with thePOST
. what am I doing wrong?Thanks