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

Disable authentication headers #194

Open
onny opened this issue Nov 22, 2020 · 2 comments
Open

Disable authentication headers #194

onny opened this issue Nov 22, 2020 · 2 comments

Comments

@onny
Copy link

onny commented Nov 22, 2020

Hey,
what is the best way to disable the authentication headers for a specific request set by this wrapper?
I tried to set 'requesttoken': null but this wont work.
I want to use the same axios instance also for external requests where I'm not allowed to send the requesttoken header.
Brest regards,
Jonas

@onny
Copy link
Author

onny commented Nov 22, 2020

I'm only able to remove default header by issuing:

delete axios.defaults.headers.requesttoken

On other occurrences, I have to reassign the header agin:

axios.defaults.headers.requesttoken = requesttoken

Which is a bit complicated to use :(

@ChristophWurst
Copy link
Contributor

Hmm interesting idea. Guess right now the only proper way to do it is using the original axios package directly in combination with this one and switch between the two depending on what type of request you want to send.

Since we create own instance in https://github.com/nextcloud/nextcloud-axios/blob/master/lib/index.ts it would be possible to also export a unmodified one so you don't have to install two packages in your app.

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

2 participants