fix(routing): give /bridge a page instead of a 404

Everything links to /bridge — the Live ATC card on the front page, the
cockpit's connect hint, and the post-login redirect the pairing screen builds
for itself — but the only page under it is /bridge/connect. The bare path
resolved to nothing, so the front page's own Live ATC card was a dead link.

Forwards to /bridge/connect from route middleware, keeping the query string so
a ?token= pairing link still works. Middleware rather than setup for the same
reason as /start and /login: an await in setup aborts the first render and
leaves a blank page.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
itsrubberduck
2026-07-30 18:58:09 +02:00
parent 3cd754962c
commit 67e8d3573c

View File

@@ -0,0 +1,19 @@
<script setup lang="ts">
// /bridge is the address everything points at — the Live ATC card on the front
// page, the cockpit's "connect a bridge" hint, and the post-login redirect the
// pairing screen builds for itself. The page behind it is /bridge/connect, so
// the bare path resolved to nothing and every one of those links 404'd.
definePageMeta({
layout: false,
// Redirect from middleware, not from setup: an `await navigateTo()` in setup
// suspends the first render and the navigation aborts it, leaving the URL
// changed and the screen blank until a reload (see /start and /login).
middleware: [to => navigateTo({ path: '/bridge/connect', query: to.query }, { replace: true })],
})
</script>
<template>
<!-- Never seen: the middleware above redirects before this page renders. It
exists so a component without a template can never be what is on screen. -->
<div />
</template>