Pages
At Lucky Media, we understand that security is a top priority for your digital data. That's why we're here to guide you on how to create password-protected pages using Formatic and Statamic. This way, you're not just keeping your content safe, you're also providing an exclusive user experience for your visitors.
Let's get started!
Before we dive into the nitty-gritty, it's necessary to understand what password protection means. In essence, it's a feature that restricts access to certain pages of your website, allowing only users with the correct password to view the content.
You can learn more about Protecting Content in Statamic.
With Formatic, setting up password protection is a breeze because it comes with an in-built template for this feature.
Open the page where you’ve included your form and want to protect it with a password.
To enable it, simply set the Password Protection to true on Form → Settings → Protected Page
.
Next, you should choose the password for accessing the secured page. To do this, navigate to the Globals
section located in the left-hand side CP menu. Within the Globals
menu, select Formatic
, where you'll find a list field to input one or multiple passwords.
Should you activate Password Protection without adding any password values, a default password has been provided for your convenience. By default, the password is set as secret
. However, for security, we highly recommend replacing this default with a unique and secure password of your choosing. The default password can be located within the service class designated for managing the Password Protection feature.
You can find this file named RetrieveUserPassword.php
in the App\\Services
directory.
And just like that, you've created a password-protected page! Your content is now secure, and only accessible to those with the correct password.