Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

globalParams are not applied to requests. #2096

Open
selcuk-sahin opened this issue Nov 18, 2024 · 0 comments
Open

globalParams are not applied to requests. #2096

selcuk-sahin opened this issue Nov 18, 2024 · 0 comments

Comments

@selcuk-sahin
Copy link

Describe the bug

Setting globalParams has no effect, parameters are not added to request

To Reproduce Steps to reproduce the behavior:

export const myClient = () => createClient<NormalizeOAS<typeof spec>>({
  endpoint: '<url>',
  globalParams: { credentials: 'include' }, // not applied
})

Expected behavior

I expected parameters would have been added

Environment:

  • OS: macOS 15.1
  • package-name...: "fets": "^0.8.3",
  • NodeJS: v20.15.0
  • "nuxt": "^3.13.2",
  • "vue": "^3.5.12",

Additional context
As a workaround, I added a custom plugin, which worked.

const credentialsSetter: ClientPlugin = {
  onRequestInit({ requestInit }) {
    requestInit.credentials = 'include'
  },
}

export const myClient = () => createClient<NormalizeOAS<typeof spec>>({
  plugins: [credentialsSetter],
  endpoint: '<url>',
})
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

No branches or pull requests

1 participant