fix: pass ISO string not Date object to sql.unsafe for expires_at
postgres.js sql.unsafe() doesn't serialize Date objects in parameterized queries — caused TypeError crashing the invite creation endpoint. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
21f88459d7
commit
9f7ab870ba
1 changed files with 1 additions and 1 deletions
|
|
@ -26,7 +26,7 @@ export async function POST(
|
|||
|
||||
// Cryptographically random 32-byte token (64 hex chars) — unguessable
|
||||
const token = randomBytes(32).toString("hex");
|
||||
const expiresAt = new Date(Date.now() + 7 * 24 * 60 * 60 * 1000); // 7 days
|
||||
const expiresAt = new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString(); // 7 days
|
||||
|
||||
const [invite] = await sql.unsafe(
|
||||
`INSERT INTO circle_invites (circle_id, token, created_by, expires_at)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue