Launch Express uses Better-Auth to secure private pages and API routes, ensuring that only authenticated users can access certain parts of your application. This guide will walk you through the process of creating and managing private content in your Launch Express project.
getCurrentUser()
to check if the user is authenticated. If not, redirect them to the login page using the signIn()
function:
auth()
function provided by Next Auth:
auth()
function in your route handlers: