Skip to content
New issue

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

Add parseOptions object to FastifyCookieOptions #162

Merged
merged 5 commits into from
Jan 2, 2022

Conversation

MoSheikh
Copy link
Contributor

@MoSheikh MoSheikh commented Jan 1, 2022

Add parseOptions type definitions to FastifyCookieOptions interface and utilize options in setCookie function.

Checklist

Copy link
Member

@darkgl0w darkgl0w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@zekth zekth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✌️

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Fixes formatting and naming consistency in new test
@MoSheikh
Copy link
Contributor Author

MoSheikh commented Jan 1, 2022

Sorry, made a small change to clean the test up

@MoSheikh
Copy link
Contributor Author

MoSheikh commented Jan 2, 2022

So I took another look and realized that the setCookie function that is added to the fastify instance wasn't doing anything with the options, so adding in an option such as domain or path as part of the plugin options on registration wouldn't do anything to the response.

I made some changes to make the options propagate to the setCookie function. Please let me know if there are any changes you'd like me to make.

plugin.js Outdated Show resolved Hide resolved
Co-authored-by: Manuel Spigolon <behemoth89@gmail.com>
@Eomm Eomm requested a review from zekth January 2, 2022 11:13
@Eomm Eomm merged commit 1b67b3c into fastify:master Jan 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add type definitions for parseOptions in FastifyCookieOptions
5 participants