I have an existing React app that uses Spotify for authentication. You click a login button, get redirected to the Spotify auth page, log into Spotify, get redirected back to my React frontend, I catch the auth code, send it to my backend, fetch the Spotify account data, save it to the database, then issue access and refresh tokens. The access token goes into app memory, with the refresh token stored in an httpOnly cookie, access token goes into every request, etc - pretty standard stuff.
I want to migrate my React app to Next.JS 13 with AppDir. How do I go about this? What do I use? I'm open to modifying the auth flow.