auth-helpers icon indicating copy to clipboard operation
auth-helpers copied to clipboard

fix: make the cookie option optional when providing options to createBrowserClient

Open shanehandley opened this issue 1 year ago • 0 comments

What kind of change does this PR introduce?

This is a proposed fix for the typings for the options argument provided when constructing a client via createBrowserClient(). The options argument is optional, but when providing options such as auth, you must also provide the cookies option since it is marked as required according to the current function signature.

What is the current behavior?

When customising any options when creating a browser client, the cookies options must also be provided, even if no extended functionality is required/wanted.

What is the new behavior?

The cookies option is no longer required when providing any other options.

Additional context

This is a proposed improvement for a workaround suggested here, and partially responds to feedback provided here, that it should not always be required, and that providing customisations to cookies has no effect (tests were added to verify, but I could not reproduce the issue).

shanehandley avatar Feb 10 '24 09:02 shanehandley