create-spillway 0.1.24 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/templates/astro/.env.example +8 -0
- package/templates/astro/README.md +7 -1
- package/templates/astro/src/env.d.ts +7 -0
- package/templates/astro/src/layouts/Layout.astro +13 -1
- package/templates/astro/src/lib/members.ts +62 -0
- package/templates/astro/src/lib/spillway.ts +2 -2
- package/templates/astro/src/middleware.ts +20 -0
- package/templates/astro/src/pages/[...path].astro +32 -3
- package/templates/astro/src/pages/auth/callback.ts +17 -0
- package/templates/astro/src/pages/auth/login.ts +11 -0
- package/templates/astro/src/pages/auth/logout.ts +12 -0
- package/templates/astro/src/styles/site.css +25 -0
- package/templates/next/.env.example +8 -0
- package/templates/next/README.md +7 -1
- package/templates/next/app/[[...slug]]/page.tsx +15 -4
- package/templates/next/app/auth/callback/route.ts +20 -0
- package/templates/next/app/auth/login/route.ts +14 -0
- package/templates/next/app/auth/logout/route.ts +16 -0
- package/templates/next/app/globals.css +25 -0
- package/templates/next/app/member/[[...slug]]/page.tsx +69 -0
- package/templates/next/components/MemberLinks.tsx +26 -0
- package/templates/next/components/MembersOnly.tsx +17 -0
- package/templates/next/components/SiteShell.tsx +5 -1
- package/templates/next/lib/member-auth.ts +31 -0
- package/templates/next/lib/members.ts +20 -0
- package/templates/next/proxy.ts +31 -0
- package/templates/nuxt/.env.example +8 -0
- package/templates/nuxt/README.md +7 -1
- package/templates/nuxt/app/assets/site.css +25 -0
- package/templates/nuxt/app/components/SiteShell.vue +12 -1
- package/templates/nuxt/app/pages/[...slug].vue +9 -1
- package/templates/nuxt/server/api/_spillway/view.get.ts +2 -1
- package/templates/nuxt/server/middleware/members.ts +9 -0
- package/templates/nuxt/server/routes/auth/callback.get.ts +20 -0
- package/templates/nuxt/server/routes/auth/login.get.ts +12 -0
- package/templates/nuxt/server/routes/auth/logout.post.ts +13 -0
- package/templates/nuxt/server/utils/members.ts +52 -0
- package/templates/nuxt/server/utils/spillway.ts +32 -6
- package/templates/nuxt/shared/spillway.ts +7 -1
- package/templates/sveltekit/.env.example +8 -0
- package/templates/sveltekit/README.md +7 -1
- package/templates/sveltekit/src/app.d.ts +4 -0
- package/templates/sveltekit/src/env.ts +3 -0
- package/templates/sveltekit/src/hooks.server.ts +6 -0
- package/templates/sveltekit/src/lib/components/SiteShell.svelte +16 -1
- package/templates/sveltekit/src/lib/server/members.ts +42 -0
- package/templates/sveltekit/src/lib/server/spillway.ts +32 -6
- package/templates/sveltekit/src/lib/site.css +25 -0
- package/templates/sveltekit/src/lib/view.ts +7 -1
- package/templates/sveltekit/src/routes/[...path]/+page.server.ts +5 -2
- package/templates/sveltekit/src/routes/[...path]/+page.svelte +11 -0
- package/templates/sveltekit/src/routes/auth/callback/+server.ts +20 -0
- package/templates/sveltekit/src/routes/auth/login/+server.ts +14 -0
- package/templates/sveltekit/src/routes/auth/logout/+server.ts +12 -0
|
@@ -202,3 +202,28 @@ body {
|
|
|
202
202
|
white-space: nowrap;
|
|
203
203
|
border: 0;
|
|
204
204
|
}
|
|
205
|
+
|
|
206
|
+
/* Members (README.md, Members): Sign in, or the member's name and Sign out, in the header. */
|
|
207
|
+
.member-link,
|
|
208
|
+
.member-links button {
|
|
209
|
+
font: inherit;
|
|
210
|
+
color: var(--sw-color-primary, #1d4ed8);
|
|
211
|
+
}
|
|
212
|
+
.member-links {
|
|
213
|
+
display: flex;
|
|
214
|
+
align-items: center;
|
|
215
|
+
gap: 0.75rem;
|
|
216
|
+
margin: 0;
|
|
217
|
+
}
|
|
218
|
+
.member-links button {
|
|
219
|
+
padding: 0.25rem 0.75rem;
|
|
220
|
+
border: 1px solid currentColor;
|
|
221
|
+
border-radius: var(--sw-radius, 8px);
|
|
222
|
+
background: transparent;
|
|
223
|
+
cursor: pointer;
|
|
224
|
+
}
|
|
225
|
+
.members-only {
|
|
226
|
+
max-width: var(--sw-max-width, 1120px);
|
|
227
|
+
margin: 2rem auto;
|
|
228
|
+
padding: 0 1rem;
|
|
229
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Metadata } from 'next';
|
|
2
|
+
import { notFound, permanentRedirect, redirect } from 'next/navigation';
|
|
3
|
+
import { cache } from 'react';
|
|
4
|
+
import { SpillwayError, pathFromParams } from '@spillway-cms/next';
|
|
5
|
+
import { SpillwayBlocks, SpillwayJsonLd, metadataFor } from '@spillway-cms/next/page';
|
|
6
|
+
import type { PublicRender } from '@spillway-cms/client';
|
|
7
|
+
import { SiteShell } from '../../../components/SiteShell';
|
|
8
|
+
import { MembersOnly } from '../../../components/MembersOnly';
|
|
9
|
+
import { asMember, currentMember, members } from '../../../lib/members';
|
|
10
|
+
import { pageLanguages, redirectFor, spillway, withSiteUrls } from '../../../lib/spillway';
|
|
11
|
+
|
|
12
|
+
type Props = { params: Promise<{ slug?: string[] }> };
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A signed-in member's pages (README.md, Members). proxy.ts rewrites their requests here, so the address stays the page's
|
|
16
|
+
* own. Spillway answers with the member's access token: members-only pages render for them, pages for other groups do not.
|
|
17
|
+
* Rendered for every request and never cached, since what it shows depends on who is looking.
|
|
18
|
+
*/
|
|
19
|
+
export const dynamic = 'force-dynamic';
|
|
20
|
+
|
|
21
|
+
const loadPage = cache(async (path: string): Promise<PublicRender | 'forbidden' | 'signin' | null> => {
|
|
22
|
+
const member = await currentMember();
|
|
23
|
+
if (!member) return 'signin';
|
|
24
|
+
try {
|
|
25
|
+
return await asMember(member).render(path);
|
|
26
|
+
} catch (err) {
|
|
27
|
+
if (err instanceof SpillwayError && err.code === 'members_only') return err.status === 403 ? 'forbidden' : 'signin';
|
|
28
|
+
// The sign-in ended at Spillway (signed out, removed, deactivated): a visitor until proxy.ts clears the session.
|
|
29
|
+
if (err instanceof SpillwayError && err.code === 'invalid_token') return 'signin';
|
|
30
|
+
if (err instanceof SpillwayError && err.status === 404) return null;
|
|
31
|
+
throw err;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
|
36
|
+
const page = await loadPage(pathFromParams(await params)).catch(() => null);
|
|
37
|
+
if (!page || typeof page === 'string') return { robots: { index: false } };
|
|
38
|
+
// Members-only pages stay out of search engines.
|
|
39
|
+
return { ...(metadataFor(withSiteUrls(page)) as Metadata), ...(page.entity.access ? { robots: { index: false } } : {}) };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default async function MemberPage({ params }: Props) {
|
|
43
|
+
const path = pathFromParams(await params);
|
|
44
|
+
const member = await currentMember();
|
|
45
|
+
// No session: nothing here (the visitor's pages are at the path itself). Never redirect to `path`: it comes decoded from the
|
|
46
|
+
// address, and /member/%2Fevil.example would send the browser to //evil.example.
|
|
47
|
+
if (!member || !members) notFound();
|
|
48
|
+
const moved = await redirectFor(path);
|
|
49
|
+
if (moved) {
|
|
50
|
+
if (moved.status === 301) permanentRedirect(moved.to);
|
|
51
|
+
redirect(moved.to);
|
|
52
|
+
}
|
|
53
|
+
const page = await loadPage(path);
|
|
54
|
+
if (!page) notFound();
|
|
55
|
+
if (typeof page === 'string') {
|
|
56
|
+
return (
|
|
57
|
+
<SiteShell member={member}>
|
|
58
|
+
<MembersOnly path={path} signedIn={page === 'forbidden'} membersOn />
|
|
59
|
+
</SiteShell>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
const site = await spillway.site().catch(() => null);
|
|
63
|
+
return (
|
|
64
|
+
<SiteShell locale={page.locale} menus={page.menus} languages={pageLanguages(site, page)} member={member}>
|
|
65
|
+
<SpillwayJsonLd page={page} />
|
|
66
|
+
<SpillwayBlocks page={page} />
|
|
67
|
+
</SiteShell>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { usePathname } from 'next/navigation';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Sign in, or the signed-in member's name and Sign out (README.md, Members). Sign in comes back to this page; Sign out is a
|
|
7
|
+
* form POST, so another site cannot sign anyone out with a link.
|
|
8
|
+
*/
|
|
9
|
+
export function MemberLinks({ member }: { member: { name?: string; email?: string } | null }) {
|
|
10
|
+
const pathname = usePathname() || '/';
|
|
11
|
+
// On a member's page the address is still the page's own; app/member is only where proxy.ts renders it.
|
|
12
|
+
const returnTo = pathname.replace(/^\/member(?=\/|$)/, '') || '/';
|
|
13
|
+
if (!member) {
|
|
14
|
+
return (
|
|
15
|
+
<a className="member-link" href={`/auth/login?returnTo=${encodeURIComponent(returnTo)}`}>
|
|
16
|
+
Sign in
|
|
17
|
+
</a>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
return (
|
|
21
|
+
<form className="member-links" method="post" action="/auth/logout">
|
|
22
|
+
<span className="member-name">{member.name || member.email || 'Signed in'}</span>
|
|
23
|
+
<button type="submit">Sign out</button>
|
|
24
|
+
</form>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** What a members-only page shows to someone who may not see it (README.md, Members). */
|
|
2
|
+
export function MembersOnly({ path, signedIn, membersOn }: { path: string; signedIn: boolean; membersOn: boolean }) {
|
|
3
|
+
return (
|
|
4
|
+
<section className="members-only">
|
|
5
|
+
<h1>{signedIn ? 'Not available' : 'Members only'}</h1>
|
|
6
|
+
{signedIn ? (
|
|
7
|
+
<p>This page is for other members of the site.</p>
|
|
8
|
+
) : membersOn ? (
|
|
9
|
+
<p>
|
|
10
|
+
This page is for members of the site. <a href={`/auth/login?returnTo=${encodeURIComponent(path)}`}>Sign in</a> to see it.
|
|
11
|
+
</p>
|
|
12
|
+
) : (
|
|
13
|
+
<p>This page is for members of the site.</p>
|
|
14
|
+
)}
|
|
15
|
+
</section>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -4,13 +4,16 @@ import { currentPreview } from '@spillway-cms/next/server';
|
|
|
4
4
|
import { spillway } from '../lib/spillway';
|
|
5
5
|
import { LanguageSwitcher } from './LanguageSwitcher';
|
|
6
6
|
import { Nav } from './Nav';
|
|
7
|
+
import { MemberLinks } from './MemberLinks';
|
|
8
|
+
import { members } from '../lib/members';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* The header and footer around a page: the site name, the `main` and `footer` menus (Structure → Menus) and the language
|
|
10
12
|
* switcher, in the page's language. A page passes the menus Spillway rendered with it; the search page and the 404 read
|
|
11
13
|
* them for their language. It lives in the pages rather than in app/layout.tsx because a layout does not know its page.
|
|
14
|
+
* With members set up, the header has Sign in, or the member's name and Sign out (`member`, given by app/member).
|
|
12
15
|
*/
|
|
13
|
-
export async function SiteShell({ locale, menus, languages = [], children }: { locale?: string; menus?: { main?: PublicMenuItem[]; footer?: PublicMenuItem[] }; languages?: LanguageLink[]; children: ReactNode }) {
|
|
16
|
+
export async function SiteShell({ locale, menus, languages = [], member = null, children }: { locale?: string; menus?: { main?: PublicMenuItem[]; footer?: PublicMenuItem[] }; languages?: LanguageLink[]; member?: { name?: string; email?: string } | null; children: ReactNode }) {
|
|
14
17
|
const preview = await currentPreview({ secret: spillway.options.previewSecret });
|
|
15
18
|
const client = preview ? spillway.withPreview(preview) : spillway;
|
|
16
19
|
const opts = locale ? { locale } : {};
|
|
@@ -27,6 +30,7 @@ export async function SiteShell({ locale, menus, languages = [], children }: { l
|
|
|
27
30
|
</a>
|
|
28
31
|
<Nav items={menus?.main ?? main?.items ?? []} label="Main" />
|
|
29
32
|
<LanguageSwitcher links={languages} />
|
|
33
|
+
{members ? <MemberLinks member={member} /> : null}
|
|
30
34
|
</header>
|
|
31
35
|
<main id="main">{children}</main>
|
|
32
36
|
<footer className="site-footer">
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { MEMBER_SESSION_MAX_AGE, createMemberAuth, memberCookieNames, memberCookieOptions, type MemberAuth } from '@spillway-cms/client/members';
|
|
2
|
+
|
|
3
|
+
// Read here rather than from ./spillway, so proxy.ts stays small.
|
|
4
|
+
const SPILLWAY_URL = (process.env.SPILLWAY_URL || 'http://localhost:3000').replace(/\/+$/, '');
|
|
5
|
+
const SITE_URL = (process.env.SITE_URL || 'http://localhost:3001').replace(/\/+$/, '');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Members (README.md, Members): sign-in through the Spillway site's OpenID Connect provider, with the front end registered
|
|
9
|
+
* under Site settings → Accounts → Front ends. On while SPILLWAY_MEMBERS_CLIENT_ID and MEMBER_SESSION_SECRET are set.
|
|
10
|
+
*
|
|
11
|
+
* The session is one cookie, sealed with MEMBER_SESSION_SECRET and HttpOnly: the browser carries it and cannot read it.
|
|
12
|
+
* proxy.ts refreshes it and sends a signed-in member's page requests to app/member, which reads Spillway with the member's
|
|
13
|
+
* own access token, so members-only pages render for them; everyone else gets the static pages.
|
|
14
|
+
*/
|
|
15
|
+
export const members: MemberAuth | null =
|
|
16
|
+
process.env.SPILLWAY_MEMBERS_CLIENT_ID && process.env.MEMBER_SESSION_SECRET
|
|
17
|
+
? createMemberAuth({
|
|
18
|
+
issuer: SPILLWAY_URL,
|
|
19
|
+
clientId: process.env.SPILLWAY_MEMBERS_CLIENT_ID,
|
|
20
|
+
clientSecret: process.env.SPILLWAY_MEMBERS_CLIENT_SECRET || undefined,
|
|
21
|
+
redirectUri: `${SITE_URL}/auth/callback`,
|
|
22
|
+
postLogoutRedirectUri: `${SITE_URL}/`,
|
|
23
|
+
secret: process.env.MEMBER_SESSION_SECRET,
|
|
24
|
+
})
|
|
25
|
+
: null;
|
|
26
|
+
|
|
27
|
+
/** Cookies are Secure when the front end is served over https. */
|
|
28
|
+
export const secureCookies = SITE_URL.startsWith('https://');
|
|
29
|
+
/** The cookies' names: `__Host-` prefixed over https, so no other site, not even a sibling subdomain, can plant one. */
|
|
30
|
+
export const { session: SESSION_COOKIE, flow: FLOW_COOKIE } = memberCookieNames(secureCookies);
|
|
31
|
+
export const sessionCookieOptions = () => memberCookieOptions(MEMBER_SESSION_MAX_AGE, secureCookies);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { cookies } from 'next/headers';
|
|
2
|
+
import { createClient, type SpillwayClient } from '@spillway-cms/client';
|
|
3
|
+
import { memberClient, type MemberSession } from '@spillway-cms/client/members';
|
|
4
|
+
import { SPILLWAY_URL } from './spillway';
|
|
5
|
+
import { members, SESSION_COOKIE } from './member-auth';
|
|
6
|
+
|
|
7
|
+
export { members, secureCookies, sessionCookieOptions } from './member-auth';
|
|
8
|
+
|
|
9
|
+
/** The signed-in member of this request, or null. proxy.ts has already refreshed the session; this only reads it. */
|
|
10
|
+
export async function currentMember(): Promise<MemberSession | null> {
|
|
11
|
+
if (!members) return null;
|
|
12
|
+
const value = (await cookies()).get(SESSION_COOKIE)?.value;
|
|
13
|
+
return (await members.session(value).catch(() => null))?.session ?? null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Spillway as the member sees it: their access token, and never Next's shared data cache. */
|
|
17
|
+
export function asMember(session: MemberSession): SpillwayClient {
|
|
18
|
+
const base = createClient({ baseUrl: SPILLWAY_URL, fetch: (input, init) => fetch(input, { ...init, cache: 'no-store' }) });
|
|
19
|
+
return memberClient(base, session);
|
|
20
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { NextResponse, type NextRequest } from 'next/server';
|
|
2
|
+
import { MEMBER_SESSION_MAX_AGE, memberCookieOptions } from '@spillway-cms/client/members';
|
|
3
|
+
import { members, secureCookies, SESSION_COOKIE } from './lib/member-auth';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Members (README.md, Members). A request with a member session cookie is refreshed here when its access token is about to
|
|
7
|
+
* expire (the new cookie goes to the browser and to the page), and a page request is rewritten to app/member, which renders
|
|
8
|
+
* with the member's own access token. A session the provider ended is cleared, and the visitor gets the static pages.
|
|
9
|
+
*/
|
|
10
|
+
export async function proxy(request: NextRequest) {
|
|
11
|
+
const raw = request.cookies.get(SESSION_COOKIE)?.value;
|
|
12
|
+
if (!members || !raw) return NextResponse.next();
|
|
13
|
+
const path = request.nextUrl.pathname;
|
|
14
|
+
const current = await members.session(raw).catch(() => undefined);
|
|
15
|
+
if (current === undefined) return NextResponse.next(); // Spillway did not answer: try again on the next request
|
|
16
|
+
const headers = new Headers(request.headers);
|
|
17
|
+
const cookie = current?.sessionCookie ?? '';
|
|
18
|
+
headers.set('cookie', request.cookies.getAll().map((c) => `${c.name}=${c.name === SESSION_COOKIE ? cookie : c.value}`).filter((c) => !c.endsWith('=')).join('; '));
|
|
19
|
+
// The search page is the same for everyone; every other page renders as the member.
|
|
20
|
+
const isPage = current && !/^\/([a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})?\/)?search\/?$/.test(path);
|
|
21
|
+
const url = request.nextUrl.clone();
|
|
22
|
+
if (isPage) url.pathname = `/member${path === '/' ? '' : path}`;
|
|
23
|
+
const response = isPage ? NextResponse.rewrite(url, { request: { headers } }) : NextResponse.next({ request: { headers } });
|
|
24
|
+
if (!current) response.cookies.set(SESSION_COOKIE, '', { ...memberCookieOptions(0, secureCookies) });
|
|
25
|
+
else if (current.refreshed) response.cookies.set(SESSION_COOKIE, current.sessionCookie, memberCookieOptions(MEMBER_SESSION_MAX_AGE, secureCookies));
|
|
26
|
+
response.headers.set('cache-control', 'private, no-store');
|
|
27
|
+
return response;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Pages only: not the API routes, sign-in routes, Next's own files, media or files with an extension.
|
|
31
|
+
export const config = { matcher: ['/((?!api/|auth/|member(?:/|$)|_next/|media/|.*\\.[a-zA-Z0-9]{1,8}$).*)'] };
|
|
@@ -20,6 +20,14 @@ SPILLWAY_PREVIEW_SECRET=
|
|
|
20
20
|
# refreshes the brand stylesheet. Pages already pick up a new brand without it.
|
|
21
21
|
DEPLOY_HOOK_URL=
|
|
22
22
|
|
|
23
|
+
# Members (README.md, Members). The front end registered in Spillway under Site settings → Accounts → Front ends, with
|
|
24
|
+
# <SITE_URL>/auth/callback as its redirect URI and <SITE_URL>/ as its post-logout redirect URI. Members are on while the
|
|
25
|
+
# client id and the session secret are set. The secret is for a confidential front end only; leave it empty for a public one.
|
|
26
|
+
SPILLWAY_MEMBERS_CLIENT_ID=
|
|
27
|
+
SPILLWAY_MEMBERS_CLIENT_SECRET=
|
|
28
|
+
# Seals the member session cookie: a random string of at least 32 characters (create-spillway wrote one). Server only.
|
|
29
|
+
MEMBER_SESSION_SECRET=
|
|
30
|
+
|
|
23
31
|
# This front end's own address: canonical links, the sitemap and robots.txt use it.
|
|
24
32
|
SITE_URL=http://localhost:3002
|
|
25
33
|
|
package/templates/nuxt/README.md
CHANGED
|
@@ -48,7 +48,13 @@ On a site with more than one language (**Site settings → Languages**), every l
|
|
|
48
48
|
|
|
49
49
|
## Members
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
Members of the Spillway site sign in on this front end through the site's own OpenID Connect provider, and see the pages only members (or members of their groups) may see. Sign-up, password resets and two-step sign-in stay on Spillway's account pages, which send the member back here.
|
|
52
|
+
|
|
53
|
+
1. In Spillway, turn on accounts (Site settings → Accounts) and, under **Front ends**, add this front end: a public front end, with `<SITE_URL>/auth/callback` as its redirect URI and `<SITE_URL>/` as its post-logout redirect URI (`http://localhost:3002/auth/callback` and `http://localhost:3002/` while you develop). A confidential front end also gets a secret, shown once.
|
|
54
|
+
2. Set `SPILLWAY_MEMBERS_CLIENT_ID` (and `SPILLWAY_MEMBERS_CLIENT_SECRET` for a confidential front end) in the env file. `MEMBER_SESSION_SECRET` seals the session cookie; create-spillway wrote a random one. `SPILLWAY_URL` must be the site's own address, the provider's issuer.
|
|
55
|
+
3. Restart. The header has **Sign in**; a members-only page asks visitors to sign in, and shows a member what Spillway shows them.
|
|
56
|
+
|
|
57
|
+
The session is one `HttpOnly` cookie, sealed with `MEMBER_SESSION_SECRET`, holding the member's tokens; the browser cannot read it, and over https it is named `__Host-spillway_member`, so no other site, not even a sibling subdomain, can plant one. `server/middleware/members.ts` reads the session into `event.context.member` (refreshing it when its access token is about to expire), and `resolveView` reads a member's pages with their own access token, never through the cache. The routes are `server/routes/auth/login.get.ts`, `callback.get.ts` and `logout.post.ts`; `server/utils/members.ts` holds the rest. Sign out ends the sign-in at Spillway too. The flow is `@spillway-cms/client/members`: the authorization code flow with PKCE, `state` and `nonce`, and the ID token checked against the site's keys, with no other dependency.
|
|
52
58
|
|
|
53
59
|
## Previews
|
|
54
60
|
|
|
@@ -215,3 +215,28 @@ body {
|
|
|
215
215
|
white-space: nowrap;
|
|
216
216
|
border: 0;
|
|
217
217
|
}
|
|
218
|
+
|
|
219
|
+
/* Members (README.md, Members): Sign in, or the member's name and Sign out, in the header. */
|
|
220
|
+
.member-link,
|
|
221
|
+
.member-links button {
|
|
222
|
+
font: inherit;
|
|
223
|
+
color: var(--sw-color-primary, #1d4ed8);
|
|
224
|
+
}
|
|
225
|
+
.member-links {
|
|
226
|
+
display: flex;
|
|
227
|
+
align-items: center;
|
|
228
|
+
gap: 0.75rem;
|
|
229
|
+
margin: 0;
|
|
230
|
+
}
|
|
231
|
+
.member-links button {
|
|
232
|
+
padding: 0.25rem 0.75rem;
|
|
233
|
+
border: 1px solid currentColor;
|
|
234
|
+
border-radius: var(--sw-radius, 8px);
|
|
235
|
+
background: transparent;
|
|
236
|
+
cursor: pointer;
|
|
237
|
+
}
|
|
238
|
+
.members-only {
|
|
239
|
+
max-width: var(--sw-max-width, 1120px);
|
|
240
|
+
margin: 2rem auto;
|
|
241
|
+
padding: 0 1rem;
|
|
242
|
+
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* The shell around every page: the site name, the main and footer menus, the language switcher, the preview bar and, with
|
|
4
|
+
* members set up (README.md, Members), Sign in or the member's name and Sign out.
|
|
5
|
+
*/
|
|
3
6
|
import type { Shell } from '#shared/spillway';
|
|
4
7
|
|
|
5
8
|
defineProps<{ shell: Shell }>();
|
|
9
|
+
const route = useRoute();
|
|
6
10
|
</script>
|
|
7
11
|
|
|
8
12
|
<template>
|
|
@@ -21,6 +25,13 @@ defineProps<{ shell: Shell }>();
|
|
|
21
25
|
</li>
|
|
22
26
|
</ul>
|
|
23
27
|
</nav>
|
|
28
|
+
<template v-if="shell.members">
|
|
29
|
+
<form v-if="shell.member" class="member-links" method="post" action="/auth/logout">
|
|
30
|
+
<span class="member-name">{{ shell.member.name || shell.member.email || 'Signed in' }}</span>
|
|
31
|
+
<button type="submit">Sign out</button>
|
|
32
|
+
</form>
|
|
33
|
+
<a v-else class="member-link" :href="`/auth/login?returnTo=${encodeURIComponent(route.fullPath)}`">Sign in</a>
|
|
34
|
+
</template>
|
|
24
35
|
</header>
|
|
25
36
|
<main id="main"><slot /></main>
|
|
26
37
|
<footer class="site-footer">
|
|
@@ -14,7 +14,9 @@ const view = data.value;
|
|
|
14
14
|
|
|
15
15
|
const event = useRequestEvent();
|
|
16
16
|
if (event && view.kind === 'not-found') setResponseStatus(event, 404, 'Page not found');
|
|
17
|
-
if (view.
|
|
17
|
+
if (event && view.kind === 'members-only') setResponseStatus(event, view.forbidden ? 403 : 401, view.forbidden ? 'Not available' : 'Members only');
|
|
18
|
+
// A preview, and anything rendered for a signed-in member, is private.
|
|
19
|
+
if (view.shell.preview || view.shell.member) useResponseHeader('cache-control').value = 'private, no-store';
|
|
18
20
|
|
|
19
21
|
const { head, shell } = view;
|
|
20
22
|
useHead({
|
|
@@ -46,6 +48,12 @@ useHead({
|
|
|
46
48
|
<SiteShell :shell="shell">
|
|
47
49
|
<div v-if="view.kind === 'page'" class="spillway-page" v-html="view.body" />
|
|
48
50
|
<SearchPage v-else-if="view.kind === 'search'" :search="view.search" :shell="shell" />
|
|
51
|
+
<section v-else-if="view.kind === 'members-only'" class="members-only">
|
|
52
|
+
<h1>{{ view.forbidden ? 'Not available' : 'Members only' }}</h1>
|
|
53
|
+
<p v-if="view.forbidden">This page is for other members of the site.</p>
|
|
54
|
+
<p v-else-if="shell.members">This page is for members of the site. <a :href="`/auth/login?returnTo=${encodeURIComponent(view.path)}`">Sign in</a> to see it.</p>
|
|
55
|
+
<p v-else>This page is for members of the site.</p>
|
|
56
|
+
</section>
|
|
49
57
|
<section v-else class="not-found">
|
|
50
58
|
<h1>Page not found</h1>
|
|
51
59
|
<p>There is no published page at this address. <a href="/">Go to the home page</a>.</p>
|
|
@@ -10,5 +10,6 @@ export default defineEventHandler(async (event) => {
|
|
|
10
10
|
for (const [key, value] of Object.entries(rest)) if (typeof value === 'string') query[key] = value;
|
|
11
11
|
const path = typeof _path === 'string' && _path.startsWith('/') ? _path : '/';
|
|
12
12
|
setResponseHeader(event, 'cache-control', 'private, no-store');
|
|
13
|
-
|
|
13
|
+
// event.context.member: the signed-in member (server/middleware/members.ts), whose pages are read with their own token.
|
|
14
|
+
return resolveView(path, query, toWebRequest(event), event.context.member ?? null);
|
|
14
15
|
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Members (README.md, Members): the signed-in member of this request into `event.context.member` (server/utils/members.ts). */
|
|
2
|
+
import { readMember } from '../utils/members';
|
|
3
|
+
|
|
4
|
+
const SKIP = ['/_nuxt/', '/__nuxt', '/_ipx/'];
|
|
5
|
+
|
|
6
|
+
export default defineEventHandler(async (event) => {
|
|
7
|
+
const { pathname } = getRequestURL(event);
|
|
8
|
+
event.context.member = SKIP.some((p) => pathname.startsWith(p)) ? null : await readMember(event);
|
|
9
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** GET /auth/callback: the code from the Spillway site becomes the member's session cookie (README.md, Members). */
|
|
2
|
+
import { MEMBER_SESSION_MAX_AGE, MemberAuthError } from '@spillway-cms/client/members';
|
|
3
|
+
import { cookieOptions, members, SESSION_COOKIE, FLOW_COOKIE, secureCookies } from '../../utils/members';
|
|
4
|
+
import { SITE_URL } from '../../utils/spillway';
|
|
5
|
+
|
|
6
|
+
export default defineEventHandler(async (event) => {
|
|
7
|
+
if (!members) throw createError({ statusCode: 404, statusMessage: 'Members are not set up on this site' });
|
|
8
|
+
setResponseHeader(event, 'cache-control', 'no-store');
|
|
9
|
+
try {
|
|
10
|
+
const { sessionCookie, returnTo } = await members.callback(new URL(event.path, SITE_URL), getCookie(event, FLOW_COOKIE));
|
|
11
|
+
setCookie(event, SESSION_COOKIE, sessionCookie, cookieOptions(MEMBER_SESSION_MAX_AGE));
|
|
12
|
+
deleteCookie(event, FLOW_COOKIE, { path: '/', secure: secureCookies });
|
|
13
|
+
return sendRedirect(event, returnTo, 303);
|
|
14
|
+
} catch (err) {
|
|
15
|
+
const message = err instanceof MemberAuthError ? err.message : 'Signing in did not work. Try again.';
|
|
16
|
+
setResponseStatus(event, 400);
|
|
17
|
+
setResponseHeader(event, 'content-type', 'text/html; charset=utf-8');
|
|
18
|
+
return `<!doctype html><title>Sign in</title><p>${message.replace(/[<&]/g, '')}</p><p><a href="/auth/login">Sign in again</a></p>`;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** GET /auth/login?returnTo=/path: off to the Spillway site's sign-in, coming back to /auth/callback (README.md, Members). */
|
|
2
|
+
import { MEMBER_FLOW_MAX_AGE } from '@spillway-cms/client/members';
|
|
3
|
+
import { cookieOptions, members, FLOW_COOKIE } from '../../utils/members';
|
|
4
|
+
|
|
5
|
+
export default defineEventHandler(async (event) => {
|
|
6
|
+
if (!members) throw createError({ statusCode: 404, statusMessage: 'Members are not set up on this site' });
|
|
7
|
+
const returnTo = getQuery(event).returnTo;
|
|
8
|
+
const { url, flowCookie } = await members.signIn({ returnTo: typeof returnTo === 'string' ? returnTo : '/' });
|
|
9
|
+
setCookie(event, FLOW_COOKIE, flowCookie, cookieOptions(MEMBER_FLOW_MAX_AGE));
|
|
10
|
+
setResponseHeader(event, 'cache-control', 'no-store');
|
|
11
|
+
return sendRedirect(event, url, 302);
|
|
12
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** POST /auth/logout (a form on this site): the sign-in ends at Spillway too, which sends the browser back here. */
|
|
2
|
+
|
|
3
|
+
import { members, SESSION_COOKIE, secureCookies } from '../../utils/members';
|
|
4
|
+
import { SITE_URL } from '../../utils/spillway';
|
|
5
|
+
|
|
6
|
+
export default defineEventHandler(async (event) => {
|
|
7
|
+
const origin = getRequestHeader(event, 'origin');
|
|
8
|
+
if (origin && origin !== new URL(SITE_URL).origin && origin !== getRequestURL(event).origin) throw createError({ statusCode: 403, statusMessage: 'Not allowed' });
|
|
9
|
+
const to = members ? await members.signOut(event.context.member ?? null) : '/';
|
|
10
|
+
deleteCookie(event, SESSION_COOKIE, { path: '/', secure: secureCookies });
|
|
11
|
+
setResponseHeader(event, 'cache-control', 'no-store');
|
|
12
|
+
return sendRedirect(event, to, 303);
|
|
13
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Members (README.md, Members): sign-in through the Spillway site's OpenID Connect provider, with this front end registered
|
|
3
|
+
* under Site settings → Accounts → Front ends. On while SPILLWAY_MEMBERS_CLIENT_ID and MEMBER_SESSION_SECRET are set.
|
|
4
|
+
*
|
|
5
|
+
* The session is one cookie, sealed with MEMBER_SESSION_SECRET and HttpOnly. server/middleware/members.ts reads it into
|
|
6
|
+
* `event.context.member`, refreshing it when its access token is about to expire; `resolveView` then reads Spillway with
|
|
7
|
+
* the member's own access token, never through the shared cache, so members-only pages render for them.
|
|
8
|
+
*/
|
|
9
|
+
import type { H3Event } from 'h3';
|
|
10
|
+
import { MEMBER_SESSION_MAX_AGE, createMemberAuth, memberCookieNames, memberCookieOptions, type MemberAuth, type MemberSession } from '@spillway-cms/client/members';
|
|
11
|
+
|
|
12
|
+
// Read here rather than from ./spillway, which imports this file.
|
|
13
|
+
const SPILLWAY_URL = (process.env.SPILLWAY_URL || 'http://localhost:3000').replace(/\/+$/, '');
|
|
14
|
+
const SITE_URL = (process.env.SITE_URL || 'http://localhost:3002').replace(/\/+$/, '');
|
|
15
|
+
|
|
16
|
+
export const members: MemberAuth | null =
|
|
17
|
+
process.env.SPILLWAY_MEMBERS_CLIENT_ID && process.env.MEMBER_SESSION_SECRET
|
|
18
|
+
? createMemberAuth({
|
|
19
|
+
issuer: SPILLWAY_URL,
|
|
20
|
+
clientId: process.env.SPILLWAY_MEMBERS_CLIENT_ID,
|
|
21
|
+
clientSecret: process.env.SPILLWAY_MEMBERS_CLIENT_SECRET || undefined,
|
|
22
|
+
redirectUri: `${SITE_URL}/auth/callback`,
|
|
23
|
+
postLogoutRedirectUri: `${SITE_URL}/`,
|
|
24
|
+
secret: process.env.MEMBER_SESSION_SECRET,
|
|
25
|
+
})
|
|
26
|
+
: null;
|
|
27
|
+
|
|
28
|
+
export const secureCookies = SITE_URL.startsWith('https://');
|
|
29
|
+
/** The cookies' names: `__Host-` prefixed over https, so no other site, not even a sibling subdomain, can plant one. */
|
|
30
|
+
export const { session: SESSION_COOKIE, flow: FLOW_COOKIE } = memberCookieNames(secureCookies);
|
|
31
|
+
export const cookieOptions = (maxAge: number) => memberCookieOptions(maxAge, secureCookies);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The member signed in on this request, or null. A refreshed session goes to the browser and into this request's own
|
|
35
|
+
* cookie header, so the page's call to /api/_spillway/view (which forwards it) sees the new one and does not refresh again.
|
|
36
|
+
*/
|
|
37
|
+
export async function readMember(event: H3Event): Promise<MemberSession | null> {
|
|
38
|
+
const raw = getCookie(event, SESSION_COOKIE);
|
|
39
|
+
if (!members || !raw) return null;
|
|
40
|
+
const current = await members.session(raw).catch(() => undefined);
|
|
41
|
+
if (current === undefined) return null; // Spillway did not answer: a visitor for now, the cookie stays
|
|
42
|
+
if (!current) {
|
|
43
|
+
deleteCookie(event, SESSION_COOKIE, { path: '/', secure: secureCookies });
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
if (current.refreshed) {
|
|
47
|
+
setCookie(event, SESSION_COOKIE, current.sessionCookie, cookieOptions(MEMBER_SESSION_MAX_AGE));
|
|
48
|
+
const header = event.node.req.headers.cookie ?? '';
|
|
49
|
+
event.node.req.headers.cookie = header.split(/;\s*/).map((c) => (c.startsWith(`${SESSION_COOKIE}=`) ? `${SESSION_COOKIE}=${current.sessionCookie}` : c)).join('; ');
|
|
50
|
+
}
|
|
51
|
+
return current.session;
|
|
52
|
+
}
|
|
@@ -20,6 +20,8 @@ import type { HeadData, SearchHit, SearchView, Shell, View } from '../../shared/
|
|
|
20
20
|
// The brand as the last build wrote it (scripts/brand.mjs); a newer published brand is inlined until the next build.
|
|
21
21
|
import builtBrand from '../../app/assets/spillway-brand.json';
|
|
22
22
|
import { cached } from './cache';
|
|
23
|
+
import { memberClient, type MemberSession } from '@spillway-cms/client/members';
|
|
24
|
+
import { members } from './members';
|
|
23
25
|
|
|
24
26
|
/** The Spillway site (SPILLWAY_URL in .env). */
|
|
25
27
|
export const SPILLWAY_URL = (process.env.SPILLWAY_URL || 'http://localhost:3000').replace(/\/+$/, '');
|
|
@@ -60,14 +62,16 @@ export function loadSite(preview: PreviewState | null = null): Promise<PublicSit
|
|
|
60
62
|
return (preview ? load() : cached('site', async () => ({ value: await load(), tags: [SHELL_TAG] }))).catch(() => null);
|
|
61
63
|
}
|
|
62
64
|
|
|
63
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* The page at `path`, or null when Spillway has none. A preview skips the cache; so does a page whose blocks read the query.
|
|
67
|
+
* A members-only page throws on (README.md, Members); `loadMemberPage` reads pages as a signed-in member.
|
|
68
|
+
*/
|
|
64
69
|
export async function loadPage(path: string, query: Record<string, string>, preview: PreviewState | null): Promise<HtmlPage | null> {
|
|
65
70
|
const fetchPage = async (params: Record<string, string>) => {
|
|
66
71
|
try {
|
|
67
72
|
return await spillway.renderHtml(path, { previewState: preview, params });
|
|
68
73
|
} catch (err) {
|
|
69
|
-
|
|
70
|
-
if (err instanceof SpillwayError && (err.status === 404 || err.code === 'members_only')) return null;
|
|
74
|
+
if (err instanceof SpillwayError && err.status === 404) return null;
|
|
71
75
|
throw err;
|
|
72
76
|
}
|
|
73
77
|
};
|
|
@@ -81,6 +85,16 @@ export async function loadPage(path: string, query: Record<string, string>, prev
|
|
|
81
85
|
return page?.queryDependent && Object.keys(query).length ? fetchPage(query) : page;
|
|
82
86
|
}
|
|
83
87
|
|
|
88
|
+
/** The page as a signed-in member sees it: with their own access token, never cached. */
|
|
89
|
+
export async function loadMemberPage(member: MemberSession, path: string, query: Record<string, string>): Promise<HtmlPage | null> {
|
|
90
|
+
try {
|
|
91
|
+
return await memberClient(spillway, member).renderHtml(path, { params: query });
|
|
92
|
+
} catch (err) {
|
|
93
|
+
if (err instanceof SpillwayError && err.status === 404) return null;
|
|
94
|
+
throw err;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
84
98
|
async function loadShellParts(locale: string, preview: PreviewState | null) {
|
|
85
99
|
const c = spillway.withPreview(preview);
|
|
86
100
|
const read = <T>(key: string, load: () => Promise<T>): Promise<T | null> =>
|
|
@@ -117,14 +131,23 @@ export function pointApiAtSpillway(html: string, origin: string): string {
|
|
|
117
131
|
return origin ? html.replace(/ action="\/api\/forms\//g, ` action="${origin}/api/forms/`).replace(/ href="\/api\/collections\//g, ` href="${origin}/api/collections/`) : html;
|
|
118
132
|
}
|
|
119
133
|
|
|
120
|
-
/** What the request at `path` (with its query string) shows. */
|
|
121
|
-
export async function resolveView(path: string, query: Record<string, string>, request: Request): Promise<View> {
|
|
134
|
+
/** What the request at `path` (with its query string) shows; `member` is the signed-in member (README.md, Members), or null. */
|
|
135
|
+
export async function resolveView(path: string, query: Record<string, string>, request: Request, member: MemberSession | null = null): Promise<View> {
|
|
122
136
|
const preview = readPreview(request);
|
|
123
137
|
const params = Object.fromEntries(Object.entries(query).filter(([k]) => !PREVIEW_PARAMS.has(k)));
|
|
124
138
|
const site = await loadSite(preview);
|
|
125
139
|
const local = site ? splitLocalePath(site, path) : { locale: 'en', path, prefixed: false };
|
|
126
140
|
const isSearch = local.path === '/search';
|
|
127
|
-
const
|
|
141
|
+
const blocked: { kind: 'members' | 'forbidden' | null } = { kind: null };
|
|
142
|
+
const page = isSearch
|
|
143
|
+
? null
|
|
144
|
+
: await (member && !preview ? loadMemberPage(member, path, params) : loadPage(path, params, preview)).catch((err) => {
|
|
145
|
+
if (!(err instanceof SpillwayError) || (err.code !== 'members_only' && err.code !== 'invalid_token')) throw err;
|
|
146
|
+
// invalid_token: the sign-in ended at Spillway (signed out, removed, deactivated); a visitor from here on.
|
|
147
|
+
if (err.code === 'invalid_token') member = null;
|
|
148
|
+
blocked.kind = err.status === 403 ? 'forbidden' : 'members';
|
|
149
|
+
return null;
|
|
150
|
+
});
|
|
128
151
|
const locale = page?.locale ?? local.locale;
|
|
129
152
|
const parts = await loadShellParts(locale, preview);
|
|
130
153
|
const siteName = site?.name ?? page?.site.name ?? 'Spillway site';
|
|
@@ -140,6 +163,8 @@ export async function resolveView(path: string, query: Record<string, string>, r
|
|
|
140
163
|
suggestions: site?.searchSuggestions ?? true,
|
|
141
164
|
searchPath,
|
|
142
165
|
preview: Boolean(preview),
|
|
166
|
+
members: Boolean(members),
|
|
167
|
+
member: member ? { ...(member.name ? { name: member.name } : {}), ...(member.email ? { email: member.email } : {}) } : null,
|
|
143
168
|
};
|
|
144
169
|
|
|
145
170
|
if (page) {
|
|
@@ -178,6 +203,7 @@ export async function resolveView(path: string, query: Record<string, string>, r
|
|
|
178
203
|
return { kind: 'search', shell, head: { ...head, title: q ? `Search: ${q} | ${siteName}` : `Search | ${siteName}` }, search };
|
|
179
204
|
}
|
|
180
205
|
shell.languages = site ? languageLinks(site, { locale, alternates: [] }) : [];
|
|
206
|
+
if (blocked.kind) return { kind: 'members-only', shell, head: { ...head, title: `Members only | ${siteName}` }, forbidden: blocked.kind === 'forbidden', path };
|
|
181
207
|
return { kind: 'not-found', shell, head: { ...head, title: `Page not found | ${siteName}` } };
|
|
182
208
|
}
|
|
183
209
|
|
|
@@ -34,6 +34,10 @@ export interface Shell {
|
|
|
34
34
|
/** The search page in the current locale (/search, /es/search). */
|
|
35
35
|
searchPath: string;
|
|
36
36
|
preview: boolean;
|
|
37
|
+
/** Members are set up (README.md, Members): the header offers Sign in, or the member's name and Sign out. */
|
|
38
|
+
members: boolean;
|
|
39
|
+
/** The signed-in member, or null. */
|
|
40
|
+
member: { name?: string; email?: string } | null;
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
/** One search result: the page and the passage that matched, with the matched words marked. */
|
|
@@ -57,4 +61,6 @@ export interface SearchView {
|
|
|
57
61
|
export type View =
|
|
58
62
|
| { kind: 'page'; shell: Shell; head: HeadData; body: string; scripts: string[] }
|
|
59
63
|
| { kind: 'search'; shell: Shell; head: HeadData; search: SearchView }
|
|
60
|
-
| { kind: 'not-found'; shell: Shell; head: HeadData }
|
|
64
|
+
| { kind: 'not-found'; shell: Shell; head: HeadData }
|
|
65
|
+
/** A members-only page this visitor may not see: `forbidden` for a member without the group, else a sign-in is needed. */
|
|
66
|
+
| { kind: 'members-only'; shell: Shell; head: HeadData; forbidden: boolean; path: string };
|
|
@@ -20,6 +20,14 @@ SPILLWAY_PREVIEW_SECRET=
|
|
|
20
20
|
# refreshes the brand stylesheet. Pages already pick up a new brand without it.
|
|
21
21
|
DEPLOY_HOOK_URL=
|
|
22
22
|
|
|
23
|
+
# Members (README.md, Members). The front end registered in Spillway under Site settings → Accounts → Front ends, with
|
|
24
|
+
# <SITE_URL>/auth/callback as its redirect URI and <SITE_URL>/ as its post-logout redirect URI. Members are on while the
|
|
25
|
+
# client id and the session secret are set. The secret is for a confidential front end only; leave it empty for a public one.
|
|
26
|
+
SPILLWAY_MEMBERS_CLIENT_ID=
|
|
27
|
+
SPILLWAY_MEMBERS_CLIENT_SECRET=
|
|
28
|
+
# Seals the member session cookie: a random string of at least 32 characters (create-spillway wrote one). Server only.
|
|
29
|
+
MEMBER_SESSION_SECRET=
|
|
30
|
+
|
|
23
31
|
# This front end's own address: canonical links, the sitemap and robots.txt use it.
|
|
24
32
|
SITE_URL=http://localhost:5173
|
|
25
33
|
|