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

Allow auth on JSON:API Index #801

Open
alexanderjsluiter opened this issue Oct 1, 2024 · 0 comments
Open

Allow auth on JSON:API Index #801

alexanderjsluiter opened this issue Oct 1, 2024 · 0 comments
Labels
enhancement New feature or request triage A new issue that needs triage

Comments

@alexanderjsluiter
Copy link

Package

next-drupal (NPM package)

Describe the feature request

First off, this library has been wonderful to use, thank you all.

As I understand it, the /jsonapi index is public by default. However, in our instance, we require authentication to browse the index. We add a few headers to all of our requests, along with an auth() callback to add a token. Can authentication be optional when retrieving a resource collection URL from the index? From what I can tell, the async getIndex(locale?: Locale): Promise<JsonApiResponse> on line 991 of client.ts would need to allow a withAuth boolean parameter. I am working around this for now in our development environment, but our production JSON:API index has extra route requirements on it in Drupal. I am pretty new to working in Javascript and NPM modules, but I'm happy to help where I can.

@alexanderjsluiter alexanderjsluiter added enhancement New feature or request triage A new issue that needs triage labels Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage A new issue that needs triage
Projects
None yet
Development

No branches or pull requests

1 participant