💚 Fixes CI web build
Some checks failed
Gitea Build Action / build-go (push) Successful in 24s
Gitea Build Action / build-nuxt (push) Failing after 5m2s

This commit is contained in:
Daniel Svitan 2025-06-05 10:09:03 +02:00
parent c4f2006e8f
commit 8068f82f13
4 changed files with 13 additions and 2 deletions

View File

@ -26,7 +26,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Bun 1.2.0
run: oven-sh/setup-bun@v2
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.2.0
- name: Display Bun version

View File

@ -0,0 +1,3 @@
export function useToken() {
return useCookie<string | undefined>("token")
}

View File

@ -6,7 +6,7 @@
</template>
<script lang="ts" setup>
const token = useCookie("token")
const token = useToken()
onMounted(() => {
if (!token.value) {

View File

@ -16,6 +16,8 @@
import * as v from "valibot"
import type { FormSubmitEvent } from "@nuxt/ui"
const token = useCookie("token")
const schema = v.object({
token: v.pipe(v.string(), v.nonEmpty("Please enter your token"))
})
@ -39,4 +41,10 @@ async function onSubmit(event: FormSubmitEvent<Schema>) {
console.log(res)
toast.add({ title: "Token saved", color: "success" })
}
onMounted(() => {
if (token.value) {
return navigateTo("/")
}
})
</script>