Skip to content

Commit

Permalink
fix: Pass cookieConfig to CookieStorage on client side
Browse files Browse the repository at this point in the history
Prior to this, the `cookieConfig` config option would only take effect when cookies were set on the
server side. Thanks to @Pikachews for pointing this out!

Fixes #7
  • Loading branch information
bjoluc committed Jul 14, 2020
1 parent 13d54c9 commit 37d625e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const withReduxCookiePersist = (makeStore: MakeStore, config?: Config) =>

const persistConfig = {
...sharedPersistConfig,
storage: new CookieStorage(cookies),
storage: new CookieStorage(cookies, sharedCookieConfig),
};

let state: any | undefined;
Expand Down Expand Up @@ -161,7 +161,7 @@ export const withReduxCookiePersist = (makeStore: MakeStore, config?: Config) =>
// Let's persist the store!
const persistConfig = {
...sharedPersistConfig,
storage: new CookieStorage(ClientCookies),
storage: new CookieStorage(ClientCookies, sharedCookieConfig),
};

// Note: We do not create a persistor here because we need no rehydration.
Expand Down

0 comments on commit 37d625e

Please sign in to comment.