feat: authentication with OAuth
All checks were successful
ci / ci (push) Successful in 16m22s

This commit is contained in:
2025-12-07 21:27:23 +01:00
parent 4e9b4a19b8
commit 40ae2145cc
25 changed files with 3114 additions and 1466 deletions

37
app/pages/login.vue Normal file
View File

@@ -0,0 +1,37 @@
<template>
<div>
<UPageHero title="Tímmál" />
<UPageSection id="login" title="Log in to your account" description="Welcome back to your workspace">
<div class="full-w flex justify-center">
<div class="flex flex-1 gap-3 max-w-200 flex-col items-stretch px-4 py-3 justify-center">
<UAlert
v-if="error"
title="Something went wrong!"
description="We couldn't log you in due to an error. Try again later. If the issue persists, try contacting the website's administrator."
color="error"
icon="i-lucide-circle-alert"
/>
<AuthOAuthProvider v-for="provider of providers" :key="provider.name" :provider="provider" />
</div>
</div>
</UPageSection>
</div>
</template>
<script lang="ts" setup>
definePageMeta({
layout: 'unauthenticated',
});
const route = useRoute();
const redirectPath = (route.query.redirect as string) || '/dashboard';
const { authProviders, error, isAuthenticated } = useAuth();
const providers = await authProviders();
watch(isAuthenticated, (authenticated) => {
if (authenticated) {
navigateTo(redirectPath);
}
});
</script>