Question · Next.js course · Module 9: Integrations and Advanced Features

forbidden() and unauthorized() in Next.js 15

What do the new forbidden() and unauthorized() functions introduced in Next.js 15 do?

Answer options

  • They delete session cookies and log the user out
  • They redirect the user to an external login page
  • They render 403 (forbidden) and 401 (unauthorized) pages respectively with custom UI
  • They block all HTTP requests to the server

You can check the correct answer by solving this task in the CodeWorlds game.