diff --git a/components/Header.vue b/components/Header.vue
index cb46f81..c9e5d99 100644
--- a/components/Header.vue
+++ b/components/Header.vue
@@ -1,10 +1,67 @@
+
+
Eurovision 2025
diff --git a/pages/login.vue b/pages/login.vue
index 70994fe..5ee4007 100644
--- a/pages/login.vue
+++ b/pages/login.vue
@@ -3,8 +3,25 @@ definePageMeta({
layout: 'login'
})
-const login = () => {
- console.log('login')
+const login = async () => {
+ const payload = {
+ username: document.getElementById('username')?.value,
+ password: document.getElementById('password')?.value
+ }
+ const config = useRuntimeConfig()
+ const apiBase = config.public.apiBase
+ const api_url = `${apiBase}/auth/token`
+ const { data: user } = await useFetch(api_url, {
+ method: 'POST',
+ body: payload
+ })
+ if (!user.value) {
+ throw createError({
+ statusCode: 401,
+ statusMessage: 'Unauthorized'
+ })
+ }
+ localStorage.setItem('user', JSON.stringify(user.value))
navigateTo('/')
}