File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
packages/remix-server-runtime Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,18 @@ describe("cookies", () => {
142
142
expect ( setCookie ) . not . toEqual ( setCookie2 ) ;
143
143
} ) ;
144
144
145
+ it ( "makes the default secrets to be an empty array" , async ( ) => {
146
+ let cookie = createCookie ( "my-cookie" ) ;
147
+
148
+ expect ( cookie . isSigned ) . toBe ( false ) ;
149
+
150
+ let cookie2 = createCookie ( "my-cookie2" , {
151
+ secrets : undefined ,
152
+ } ) ;
153
+
154
+ expect ( cookie2 . isSigned ) . toBe ( false ) ;
155
+ } ) ;
156
+
145
157
it ( "makes the default path of cookies to be /" , async ( ) => {
146
158
let cookie = createCookie ( "my-cookie" ) ;
147
159
Original file line number Diff line number Diff line change @@ -86,8 +86,7 @@ export const createCookieFactory =
86
86
unsign : UnsignFunction ;
87
87
} ) : CreateCookieFunction =>
88
88
( name , cookieOptions = { } ) => {
89
- let { secrets, ...options } = {
90
- secrets : [ ] ,
89
+ let { secrets = [ ] , ...options } = {
91
90
path : "/" ,
92
91
sameSite : "lax" as const ,
93
92
...cookieOptions ,
You can’t perform that action at this time.
0 commit comments