A4: app shell (layout, nav, tokens, error/empty states, /api/health)
Fixes the A4 blocker: /api/dev/complete now establishes the Auth.js session. Root cause was UntrustedHost (trustHost defaulted false in pnpm start / production because setEnvDefaults derives it from AUTH_URL, not NEXTAUTH_URL, and assertConfig checks it before that default applies). Added trustHost: true to the auth config; rebuilt. Complete response now sets authjs.session-token, /schedule returns 200, and all 4 e2e shell tests pass. Also ignores test-results/ artifacts.
This commit is contained in:
@@ -38,6 +38,12 @@ export const authConfig = {
|
||||
],
|
||||
session: { strategy: "jwt" },
|
||||
secret: process.env.AUTH_SECRET ?? process.env.NEXTAUTH_SECRET,
|
||||
// Auth.js v5 gates the callback on the request `Host` header and throws
|
||||
// `UntrustedHost` unless `trustHost` is true. In `pnpm start` (production)
|
||||
// the env-based default is false, which silently drops the session cookie
|
||||
// on the magic-link callback (the A4 blocker). This is a localhost app behind
|
||||
// a reverse proxy, so trusting the Host header is the documented fix.
|
||||
trustHost: true,
|
||||
pages: { signIn: "/login" },
|
||||
callbacks: {
|
||||
async jwt({ token, user }) {
|
||||
|
||||
Reference in New Issue
Block a user