File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
packages/commerce-sdk-react/src Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -155,11 +155,12 @@ const CommerceApiProvider = (props: CommerceApiProviderProps): ReactElement => {
155155 const configLogger = logger || console
156156
157157 // When HttpOnly cookies are enabled, ensure fetch credentials allow cookies to be sent.
158- const effectiveFetchOptions =
159- useHttpOnlySessionCookies &&
160- ( ! fetchOptions ?. credentials || fetchOptions . credentials === 'omit' )
158+ const effectiveFetchOptions = useMemo ( ( ) => {
159+ return useHttpOnlySessionCookies &&
160+ ( ! fetchOptions ?. credentials || fetchOptions . credentials === 'omit' )
161161 ? { ...fetchOptions , credentials : 'same-origin' as RequestCredentials }
162162 : fetchOptions
163+ } , [ useHttpOnlySessionCookies , fetchOptions ] )
163164
164165 const auth = useMemo ( ( ) => {
165166 return new Auth ( {
You can’t perform that action at this time.
0 commit comments