🐳 Adds dockerfile
All checks were successful
Gitea Build Action / build-go (push) Successful in 23s
Gitea Build Action / build-nuxt (push) Successful in 10m5s

This commit is contained in:
Daniel Svitan
2025-06-06 22:12:54 +02:00
parent 18a6bef20a
commit 88c31a5133
7 changed files with 118 additions and 28 deletions

View File

@@ -37,33 +37,17 @@ const toast = useToast()
async function onSubmit(event: FormSubmitEvent<Schema>) {
const received = event.data.token
await $fetch("https://door.svitan.dev/open", {
await $fetch(useAPI("/open"), {
method: "GET",
headers: {
Authorization: `Bearer ${received}`,
},
async onRequestError({ error }) {
toast.add({
title: "Error occurred",
description: error.message,
color: "error",
})
},
async onResponse({ response }) {
if (response.status === 200) {
toast.add({ title: "Token saved", color: "success" })
token.value = received
navigateTo("/")
} else if (response.status === 401) {
toast.add({ title: "Token not valid", color: "error" })
} else {
toast.add({
title: "Error occurred",
description: await response.text(),
color: "error",
})
}
},
onRequestError: handleRequestError,
onResponse: handleResponse(() => {
toast.add({ title: "Token saved", color: "success" })
token.value = received
navigateTo("/")
}),
})
}