This video shows how to consume Authenticated APIs (both Server-side rendering and client-side rendering). We will check the page authentication status based on the API responses.

In this simple example, If the API response status is 401, it means the user is not logged in, so we redirect them to the /login page.

In order to call the API from server-side rendering, we are “forwarding” all the cookies we receive from the client to the fetch (API) call.

#nuxt-js #javascript #reactjs #web-development

Next.js Tutorial - Part 7 | Consume Authenticated APIs with Cookies
1.70 GEEK