Skip to content

Default set cookies to signed when keys are configured - #182

Open
raashish1601 wants to merge 1 commit into
pillarjs:masterfrom
raashish1601:codex/default-signed-cookies
Open

Default set cookies to signed when keys are configured#182
raashish1601 wants to merge 1 commit into
pillarjs:masterfrom
raashish1601:codex/default-signed-cookies

Conversation

@raashish1601

Copy link
Copy Markdown

Fixes #82.

Cookies#get() already defaults to signed reads when keys are configured, but Cookies#set() only wrote the companion .sig cookie when an options object was supplied. That made cookies.set('name', 'value') unsigned while cookies.set('name', 'value', {}) was signed.

This removes the extra opts guard so the existing signed default is honored consistently. The added tests cover both defaults: keys present creates the .sig cookie, and keys absent remains unsigned.

Validation:

  • npm test
  • npm run lint

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.

default signed or not when keys present

1 participant