Skip to content

Fix: Error accessing cookies in fusionauth. If you are using SSR you must configure the SDK with a cookie adapter#177

Merged
mrudatsprint merged 1 commit intoFusionAuth:mainfrom
TGTGamer:patch-1
Apr 8, 2026
Merged

Fix: Error accessing cookies in fusionauth. If you are using SSR you must configure the SDK with a cookie adapter#177
mrudatsprint merged 1 commit intoFusionAuth:mainfrom
TGTGamer:patch-1

Conversation

@TGTGamer
Copy link
Copy Markdown

What is this PR and why do we need it?

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.

Pre-Merge Checklist (if applicable)

  • Unit and Feature tests have been added/updated for logic changes, or there is a justifiable reason for not doing so.

…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.
Copy link
Copy Markdown

@valerii15298 valerii15298 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 mrudatsprint merged commit 9633cd5 into FusionAuth:main Apr 8, 2026
@valerii15298
Copy link
Copy Markdown

@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

@mrudatsprint
Copy link
Copy Markdown
Contributor

@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.

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.

3 participants