Tanner Barcelos
TTCTheo's Typesafe Cult
•Created by Tanner Barcelos on 11/16/2024 in #questions
How to modify the fetch function for client uploads so I can include credentials
Hi folks, I am new to UploadThing and got file uploads working with my React client and Fastify API.
One issue I am having is that I had to get rid of
http-only
cookie based auth for my JWT storage and had to fallback to local storage just so I could send my token over the wire from the file upload dropzone in the react code to my Fastify app. I use the token to validate that the user is authenticated and then upload the url to my db.
Obviously storing the token in local-storage is less secure than an http-only cookie, but I cannot seem to include credentials in the uploadthing component.
Does anyone know how I can send cookies (or if that's even supported in UploadThing) ?1 replies