Function
setCookie
(
reply: FastifyReply,
name: string,
value: string,
options?: CookieSerializeOptions,
)
Source from the content-addressed store, hash-verified
| 6 | import type { FastifyReply } from 'fastify'; |
| 7 | |
| 8 | export function setCookie( |
| 9 | reply: FastifyReply, |
| 10 | name: string, |
| 11 | value: string, |
| 12 | options?: CookieSerializeOptions, |
| 13 | ) { |
| 14 | void reply.setCookie(name, value, { |
| 15 | secure: !process.env.DEV, |
| 16 | domain: process.env.HOST, |
| 17 | path: '/', |
| 18 | sameSite: 'strict', |
| 19 | httpOnly: true, |
| 20 | |
| 21 | ...options, |
| 22 | }); |
| 23 | } |
| 24 | export function clearCookie( |
| 25 | reply: FastifyReply, |
| 26 | name: string, |
Tested by
no test coverage detected