Merge branch 'release/0.19' into feat/advanced-permissions

This commit is contained in:
dswbx
2025-10-24 15:15:56 +02:00
committed by GitHub
32 changed files with 587 additions and 107 deletions

View File

@@ -42,6 +42,7 @@ export interface UserPool {
const defaultCookieExpires = 60 * 60 * 24 * 7; // 1 week in seconds
export const cookieConfig = s
.strictObject({
domain: s.string().optional(),
path: s.string({ default: "/" }),
sameSite: s.string({ enum: ["strict", "lax", "none"], default: "lax" }),
secure: s.boolean({ default: true }),
@@ -288,6 +289,7 @@ export class Authenticator<
return {
...cookieConfig,
domain: cookieConfig.domain ?? undefined,
expires: new Date(Date.now() + expires * 1000),
};
}
@@ -377,7 +379,10 @@ export class Authenticator<
// @todo: move this to a server helper
isJsonRequest(c: Context): boolean {
return c.req.header("Content-Type") === "application/json";
return (
c.req.header("Content-Type") === "application/json" ||
c.req.header("Accept") === "application/json"
);
}
async getBody(c: Context) {