Implemented actual authentication guards, began implementing main login user flows

This commit is contained in:
2025-10-19 19:27:48 -04:00
parent e6016a19bb
commit 5d7ebd2136
12 changed files with 237 additions and 80 deletions

View File

@@ -23,6 +23,7 @@ onMounted(async () => {
const router = useRoute();
const appIDRaw = router.params.id.toString();
const raw = await loadApplication(appIDRaw);
console.log(raw);
if (raw === null) {
//new app
appData.value = null
@@ -43,7 +44,7 @@ onMounted(async () => {
readOnly.value = true;
}
} catch (e) {
console.error(e)
console.error(e);
}
loading.value = false;
})

24
ui/src/pages/Join.vue Normal file
View File

@@ -0,0 +1,24 @@
<template>
<div class="min-h-screen flex items-center justify-center ">
<div class="w-full max-w-2xl mx-auto p-8 text-center">
<h1 class="text-4xl sm:text-5xl font-extrabold mb-4">
welcome to the 17th
</h1>
<p class=" mb-8">
Welcome click below to get started.
</p>
<Button class="w-44" @click="goToLogin">Get started</Button>
</div>
</div>
</template>
<script setup>
import Button from '@/components/ui/button/Button.vue';
function goToLogin() {
window.location.href = 'https://aj17thdevapi.nexuszone.net/login';
}
</script>

View File

@@ -0,0 +1,40 @@
<template>
<div class="min-h-screen flex flex-col items-center justify-center text-center px-6">
<h1 class="text-5xl font-bold mb-4">Unauthorized</h1>
<p class="text-lg text-muted-foreground max-w-md mb-6">
You don't have permission to access this page.
If you think this is a mistake, please contact an administrator.
</p>
<div class="flex flex-col gap-3 sm:flex-row">
<Button variant="default" @click="goHome">
Go to Home
</Button>
<Button variant="outline" @click="loginIfNeeded">
Log In
</Button>
</div>
</div>
</template>
<script setup lang="ts">
import Button from '@/components/ui/button/Button.vue'
import { useRouter } from 'vue-router'
import { useUserStore } from '@/stores/user' // adjust path to your store
const router = useRouter()
const user = useUserStore()
function goHome() {
router.push('/')
}
function loginIfNeeded() {
if (!user.isLoggedIn) {
window.location.href = 'https://your-auth-service/login'
} else {
router.push('/')
}
}
</script>