Skip to content

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

Open
TGTGamer wants to merge 1 commit intoFusionAuth:mainfrom
TGTGamer:patch-1
Open

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

Conversation

@TGTGamer
Copy link

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

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

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.

2 participants