upchunk icon indicating copy to clipboard operation
upchunk copied to clipboard

How to set withCredentials = true options.

Open tom-turner opened this issue 3 years ago • 3 comments

Hey!

I could not figure out how to set headers to include credentials on the request. How is this done?

Thanks, Tom.

tom-turner avatar Apr 16 '22 19:04 tom-turner

@tom-turner we don't currently have a way to set withCredentials in this library. Note that this is different from setting the headers, which this library does support.

Can you tell me a bit more about your use case? If it's an obvious missing feature, I could probably whip up a PR to implement this functionality pretty quickly.

davekiss avatar Apr 17 '22 18:04 davekiss

Hey! sorry for my late reply.

I'm was hoping to use httpOnly cookies for user auth and i would like these to be included in the request to the server. I don't think setting my own headers is an option as i cant access the cookie from the client side. Would be amazing if there was a way to include credentials on the request.

Many thanks! Tom.

tom-turner avatar Apr 21 '22 20:04 tom-turner

@tom-turner Is your use case an attempt to link a frontend UI to Laravel back-end? I was wondering if it had anything to do with this too as the request performed by the plugin keeps giving me 419 which I suspect is relative to the above missing configuration.

wyxos avatar May 22 '22 13:05 wyxos