fix(frontend): harden auth routing and callback error handling

This commit is contained in:
Chris
2026-03-30 02:46:35 +08:00
parent 278c2b6c67
commit 7b3f5bd5b8
4 changed files with 30 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div class="min-h-screen bg-gray-50">
<nav v-if="!isLoginPage" class="bg-white border-b border-gray-200 px-6 py-3 flex items-center justify-between shadow-sm">
<nav v-if="showNav" class="bg-white border-b border-gray-200 px-6 py-3 flex items-center justify-between shadow-sm">
<div class="flex items-center gap-6">
<span class="font-bold text-gray-800 text-base">member.ose.tw</span>
<router-link
@@ -56,7 +56,10 @@ const route = useRoute()
const router = useRouter()
const authStore = useAuthStore()
const isLoginPage = computed(() => route.name === 'login')
const showNav = computed(() => {
const onAuthPage = route.name === 'login' || route.name === 'auth-callback'
return authStore.isLoggedIn && !onAuthPage
})
function handleAdminNav(command) {
const routes = {