Files
OpenSquawk/app/pages/logout.vue
itsrubberduck f08e8f5a96 fix(routing): catch the paths the split left pointing at nothing
Three dead ends, one cause: these routes resolved to pages that stayed on the
website, and nothing here answered them any more.

/start — this page became the app's front page in the split (it is index.vue
now), so every pre-split bookmark and the website's own redirect landed on a
404. Caught here so the app's old URLs work without waiting for the website to
be redeployed.

/login — the app has no login by design, identity comes from the issuer. But
five call sites still send people there: logout, the live-atc session guard,
the bridge pairing screen. In the monorepo that path was the website's login
form; since the split it was nothing, so signing out dropped the user on a
blank page. It is a forwarder to the issuer, not a login form.

/logout — after clearing the app session it sent the user to /login, which
under SSO means an issuer where they are still signed in: they would be handed
a fresh code and land straight back inside. It now signs them out at the issuer
too, which bumps tokenVersion and invalidates every refresh token.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-28 19:37:27 +02:00

50 lines
1.5 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div class="min-h-screen bg-[#0b1020] text-white">
<div class="mx-auto flex min-h-screen max-w-xl flex-col items-center justify-center gap-6 px-6 text-center">
<div class="space-y-3">
<p class="text-xs uppercase tracking-[0.3em] text-cyan-300/80">OpenSquawk</p>
<h1 class="text-3xl font-semibold">Signing you out</h1>
<p class="text-sm text-white/70">
We're logging you out and will redirect you in a moment.
</p>
</div>
<v-progress-circular indeterminate size="40" width="3" color="cyan" />
<NuxtLink to="/login" class="text-sm text-cyan-300 underline">Back to login</NuxtLink>
</div>
</div>
</template>
<script setup lang="ts">
import { onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { useAuthStore } from '~/stores/auth'
const router = useRouter()
const auth = useAuthStore()
const config = useRuntimeConfig()
useHead({
title: 'Logout OpenSquawk',
meta: [
{ name: 'robots', content: 'noindex' },
],
})
onMounted(async () => {
await auth.logout()
// Sign out at the issuer too. Sending the user to the app's own /login would
// only forward them back to an issuer where they are still signed in — they
// would be handed a fresh code and land straight back inside, which is not
// what "log out" means.
const issuer = String(config.public.authIssuer || '').replace(/\/+$/, '')
if (issuer) {
return navigateTo(`${issuer}/logout`, { external: true })
}
router.replace('/')
})
</script>