queen.raae.codes · a developer’s logbook
1 min read

Failing to use NextAuth with a Xata Worker for Prune your Follows

Written in 2023, 3 years ago. Tools and advice may have moved on since.

I naively thought all we needed for NextAuth to work with a Xata Worker was getting access to the NEXTAUTH_SECRET env variable.

But alas, when moving to a Xata Worker, the cookie set by NextAuth is unavailable as the Worker is served from another domain. However, the getToken function can also get the token from the `Authorization: ‘Bearer token’. But how do we make that happen 🤷‍♀️

That feeling when you realise on stream that your cookie + JWT knowledge is not as solid as you thought...well it will become solid!

We’ll figure it out over the next few weeks! I am sure 💪

If you have any experience with Cloudflare Workers (Xata Workers are an abstraction on top of Cloudflare Workers) and NextAuth, please reach out 🙏

 

All the best,
Queen Raae

Join the crew!

All the shenanigans from me and my piratical family, straight to your inbox.

Search the log

↑↓ to move · Enter to open · Esc to close All entries →