urls corrected on fetch

This commit is contained in:
2026-01-20 22:25:00 +00:00
parent c9189c4ef1
commit 2577dc46ee
4 changed files with 21 additions and 8 deletions

View File

@@ -3,6 +3,9 @@ import * as z from 'zod'
import type { FormSubmitEvent, AuthFormField } from '@nuxt/ui'
const toast = useToast()
const config = useRuntimeConfig()
const base_url = config.app.baseURL.endsWith('/') ? config.app.baseURL.slice(0, -1) : config.app.baseURL
const wrong_login = ref(false)
@@ -36,8 +39,7 @@ const schema = z.object({
type Schema = z.output<typeof schema>
function onSubmit(payload: FormSubmitEvent<Schema>) {
console.log(payload.data)
return fetch("/login", {
return fetch(base_url + "/login", {
method: "POST",
headers: {
"Content-Type" : "application/json"