I am using Next.js 13 for development
and I have no experience with Server-Side Rendering (SSR).
what's my problem is
I have a custom backend API based on Express.js.
This backend service already implements authentication features like login, signup, logout, and even social login using Google.
I intend to continue using my existing backend authentication service instead of adopting Next.js's next-auth
authentication system.
I have reasons for this decision:
Next.js can be used for full-stack applications, but for me feels more like frontend side.
Since my backend service is already established, I want to reuse its authentication capabilities.
currently logic In my frontend,
cookie - I'm retrieving cookies from the server fetch (next.js) to verify the user's login status.
it works fine so far (as beginner perspective)
I'm curious if there's other way to use my backend API to handle authentication similarly, without relying on next-auth
.
I would like to explore alternative solutions and check if this approach is a valid strategy.
in the frontend
cookie from fetching data on the server has jwt , i decoded to put username on the navbar