I have a headless API using express and passport.js with a few strategies for OAuth authentication and also a local strategy for username and password with jwt + cookies. I was wondering how can I use my external API in next.js?
Am I supposed to redirect the user to my API routes for authentication and the API redirects the user back to the client?
I really need to understand the flow and how people usually do that.
Thank you in advance.
I have a headless API using express and passport.js with a few strategies for OAuth authentication and also a local strategy for username and password with jwt + cookies. I was wondering how can I use my external API in next.js? Am I supposed to redirect the user to my API routes for authentication and the API redirects the user back to the client? I really need to understand the flow and how people usually do that. Thank you in advance.