Fix: Error accessing cookies in fusionauth. If you are using SSR you must configure the SDK with a cookie adapter#177
Conversation
…must configure the SDK with a cookie adapter When using the `next-client-cookies` as per documentation, the `nextCookieAdapter` is not passed as it's not included in the config. This causes the coreSDK to fail to grab the cookies. As the config object is using the `SDKConfig` and `FusionAuthProviderConfig` is expected, I've change the function parameter from `config` to `props` to pass the correct `FusionAuthProviderConfig` object forward.
There was a problem hiding this comment.
Also have this issue, ended up digging into source code and patching it myself.
Also would be better to just pass general adapter not next specific. As I checked from implementation it just needs get method to get cookie by name, and that is not next.js specific.
|
@mrudatsprint hello, would you be up to review a PR to make this option not nextjs specific? All it needs is just a function to get cookie by name which is trivial change to make. The parameter could be called something like getCookie or cookieGetter etc |
Hi @valerii15298, yes I can take a look at a more general solution. |
What is this PR and why do we need it?
When using the
next-client-cookiesas per documentation, thenextCookieAdapteris not passed as it's not included in the config. This causes the coreSDK to fail to grab the cookies.As the config object is using the
SDKConfigandFusionAuthProviderConfigis expected, I've change the function parameter fromconfigtopropsto pass the correctFusionAuthProviderConfigobject forward.Pre-Merge Checklist (if applicable)