fix(auth): rewire OIDC logout/error flow through Nuxt pages
Migrate three render callbacks in oidc-provider (logoutSource,
postLogoutSuccessSource, renderError) from the baked guildPageShell
helper to Nuxt pages under app/pages/auth/, so they go through the
font module and design system instead of a shadow copy.
- Delete guildPageShell (~103 lines of shadow design system).
- Add /auth/logout-success, /auth/oidc-error, /auth/logout-confirm
pages built on dashed-box + btn + main.css tokens.
- renderError now allow-lists error + error_description into query
params and lets Vue default interpolation escape them, closing an
XSS where OIDC error fields were concatenated into raw HTML.
- logoutSource extracts the xsrf from oidc-provider's stable form
output, sets it as an httpOnly 2-minute cookie, and redirects to
/auth/logout-confirm. The confirm page reads the cookie during SSR,
persists the value to useState, and clears the cookie so it's
strictly one-time use. Defensive fallback keeps the raw auto-submit
form if oidc-provider ever changes its form format.
- Fix form actions emitting http:// in production at the root cause:
oidc-provider extends Koa but calls super() with no args, so
app.proxy defaults to false and ctx.protocol ignores
X-Forwarded-Proto. Set _provider.proxy = true after construction;
remove the bogus proxy:true config key (silently ignored) and the
form.replace('http://', 'https://') symptom patch. Make the
x-forwarded-proto override in the catchall conditional on
production + missing header (was unconditional + dead code).
- Add site-wide .btn:focus-visible rule in main.css for WCAG 2.4.7.
Verified in browser: Brygada 1918 loads on all three pages, contrast
ratios pass AA in dark + light, XSS payload escapes to text nodes
only, Set-Cookie: Max-Age=0 enforces one-time xsrf use, no
horizontal overflow at 500px, no console errors.
This commit is contained in:
parent
98d3610a08
commit
de3bcc479a
6 changed files with 367 additions and 143 deletions
71
app/pages/auth/logout-success.vue
Normal file
71
app/pages/auth/logout-success.vue
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
<script setup lang="ts">
|
||||
definePageMeta({ layout: false });
|
||||
useHead({ title: "Signed Out — Ghost Guild" });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main class="auth-shell">
|
||||
<div class="dashed-box auth-box">
|
||||
<header class="auth-header">
|
||||
<p class="section-label">Ghost Guild</p>
|
||||
<h1 class="auth-title">Signed Out</h1>
|
||||
</header>
|
||||
|
||||
<hr class="section-divider" />
|
||||
|
||||
<p class="auth-body" role="status">
|
||||
You have been successfully signed out of your session.
|
||||
</p>
|
||||
|
||||
<a href="https://wiki.ghostguild.org" class="btn btn-primary auth-btn">
|
||||
Return to Wiki
|
||||
</a>
|
||||
</div>
|
||||
</main>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.auth-shell {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
min-height: 100vh;
|
||||
min-height: 100dvh;
|
||||
padding: var(--page-pad-y) var(--page-pad-x);
|
||||
}
|
||||
|
||||
.auth-box {
|
||||
width: 100%;
|
||||
max-width: 360px;
|
||||
padding: 24px 28px;
|
||||
}
|
||||
|
||||
.auth-header {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.auth-title {
|
||||
font-family: var(--font-display);
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
line-height: 1.1;
|
||||
letter-spacing: -0.01em;
|
||||
color: var(--candle);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.auth-body {
|
||||
font-size: 14px;
|
||||
color: var(--text);
|
||||
line-height: 1.55;
|
||||
text-align: center;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.auth-btn {
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 4px;
|
||||
}
|
||||
</style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue