Accounts: product tests (sign out everywhere, back-channel calls, deletion, export, Connect, admin), lib tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 13:36:18 +02:00
co-authored by Claude Opus 5.5
parent 069b66fd30
commit a888260f01
5 changed files with 312 additions and 2 deletions
@@ -124,6 +124,11 @@ export async function createProvider(ctx: Ctx): Promise<Provider> {
Session: (_k, session) => (session.transient ? DAY : sessionDays * DAY),
},
renderError: renderError(ctx),
// oidc-provider refuses private addresses for back-channel logout (its SSRF protection). Local
// testing only (LINKS_ALLOW_PRIVATE): send without that check, as for the other link calls.
...(ctx.config.allowPrivateLinks && !ctx.config.production
? { fetch: (input: string | URL | Request, init?: RequestInit) => { const { dispatcher: _d, ...rest } = (init ?? {}) as RequestInit & { dispatcher?: unknown }; return fetch(input, rest); } }
: {}),
rotateRefreshToken: false,
issueRefreshToken: () => false,
};
+1 -1
View File
@@ -36,7 +36,7 @@ export async function signOutEverywhere(ctx: Ctx, provider: Provider, accountId:
told++;
}
} catch (e) {
console.warn(`[sessions] back-channel logout to ${clientId} failed:`, (e as Error).message);
console.warn(`[sessions] back-channel logout to ${clientId} failed:`, (e as Error).message, (e as { cause?: Error }).cause?.message ?? '');
}
}
await ctx.db.oidcPayload.deleteMany({ where: { id: row.id } });