- Add the required environment variables to your
.env
file.
- Create the utility function to authenticate the user.
Call the authenticateUser function in the loader of the protected page.
Handle the happy path, as the errors will be guided to the ErrorBoundary.
Nothing fancy in the root, maybe add the Header here for global protection. Also ensure to have a proper error boundary in place.