We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, parseOptions is not defined under FastifyCookieOptions. I was hoping to change the FastifyCookieOptions interface to the following:
parseOptions
FastifyCookieOptions
// plugin.d.ts export interface FastifyCookieOptions { secret?: string | string[]; parseOptions?: CookieSerializeOptions; }
And add the following test:
// test/plugin.d.ts const appWithParserOptions = fastify(); const parseOptions: fastifyCookieStar.CookieSerializeOptions = { domain: "example.com", encode: (value: string) => value, expires: new Date(), httpOnly: true, maxAge: 3600, path: "/", sameSite: "lax", secure: true, signed: true, }; expectType<fastifyCookieStar.CookieSerializeOptions>(parseOptions); appWithParserOptions.register(cookie, { secret: "testsecret", parseOptions, }); appWithParserOptions.after(() => { server.get("/", (request, reply) => { const { valid, renew, value } = reply.unsignCookie(request.cookies.test); expectType<boolean>(valid); expectType<boolean>(renew); expectType<string | null>(value); }); });
No response
The text was updated successfully, but these errors were encountered:
Thanks! Would you like to send a Pull Request to address this issue?
Sorry, something went wrong.
Sure! I did try pushing a branch through but it gave me a Permission Denied error - would I need to be added as a contributer?
Permission Denied
You'll need to fork the project first, take a look at https://www.google.com/amp/s/www.freecodecamp.org/news/how-to-make-your-first-pull-request-on-github-3/amp/
@mcollina Oh right - thank you! Here's the PR.
Successfully merging a pull request may close this issue.
Prerequisites
🚀 Feature Proposal
Currently,
parseOptions
is not defined underFastifyCookieOptions
. I was hoping to change theFastifyCookieOptions
interface to the following:And add the following test:
Motivation
No response
Example
No response
The text was updated successfully, but these errors were encountered: