urls corrected on fetch
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user