Serving a Gatsby site with reduced user access
You might be asking yourself why you would ever want to reduce the access to your site. One word – security. In all the examples we have seen so far, our site is public and out there on the internet for all to see, but what if you are building an application that is only for a selected group of people? Perhaps it's portfolio work that you want to have locked behind a password or an onboarding application that should only be available to colleagues at a specific company. We can achieve functionalities such as these using most backend web applications.
Important Note
This type of authentication is not to be confused with that of Chapter 11, Creating Authenticated Experiences. Here, we are restricting access to the entirety of the site unless you have been approved. In Chapter 11, Creating Authenticated Experiences, access is only partially restricted, as we allow users to visit parts of the application without logging...