Using a custom backend/api
Unanswered
Transvaal lion posted this in #help-forum
Transvaal lionOP
Inwas wondering which is a better approach, there is en external backend api with login, signup and a lot of other endpoints.
Currently all requests are done client side to the backend directly using fetch in ‘use client’ components where the session token is stored in a cookie. This seems to work fine, but some components flashes when loading the website for the first time.
Is it okay to keep using this approach, or is it better to forward all api requests within next and have the auth token in the cookie of the next website so it can do server side rendered things when a user is already logged in?
Currently all requests are done client side to the backend directly using fetch in ‘use client’ components where the session token is stored in a cookie. This seems to work fine, but some components flashes when loading the website for the first time.
Is it okay to keep using this approach, or is it better to forward all api requests within next and have the auth token in the cookie of the next website so it can do server side rendered things when a user is already logged in?