uploadthing - Integration with authjs

When creating middleware for uploadthing, I noticed that there's no easy way to get a request that can be passed to authjs. The auth function seems like it should work, but the signature taking requests expects a NextApiRequest rather than a NextRequest, and also expects a NextApiResponse as the second argument, which the uploadthing middleware method does not provide AFAIK. Does the uploadthing sdk provide a way to get information in a format that makes authjs happy, or is there other authjs methods I can use for this?
1 Reply
Joao Camargo
Joao Camargo3d ago
use getToken() from next-auth/jwt, which is compatible with NextRequest

Did you find this page helpful?