Magento 2 Force Login module allows the store owners to restrict access to particular pages and enable information visibility to logged-in customers. Customers can view specific pages only after sign-in in to the website.
Table of Content
Features
- Restrict various pages access and allow it for logged in users only.
- Set custom URL for redirection after user login
- Enable force customer login for specific pages.
- Disable customers registration directly.
- Show custom error message for non accessible pages.
Steps:
- Extension Installation Guide
- How to Configure
- Extension Installation
- Download the zip file
- Extract and put it into /app/code/
- Open Cli in the Magento directory and follow the below commands:
- php bin/magento setup:upgrade
- php bin/magento setup:di:compile
- php bin/magento setup:static content:deploy
- php bin/magento cache:clean
- php bin/magento cache:flush
- Configuration:
- Force Login : From the admin, enable or disable the extension.
- Alert Message : As soon as the module is enabled, set an alert message.
- Select Page > Before accessing the page, choose the ones you wish to log in to.
- Enable Force Login On pages : Select “Yes to allow forced login on other pages; select “No to disable it.
- Enable Force Login On CMS Page : pick “Yes to display the Force login on the CMS page; otherwise, pick “No.
- Select CMs Page : If you wish to enable forced login, select the CMS pages.

- The login page is automatically redirected to users. When you pick Enable pages,a warning notice appears.

- The website automatically reroutes to the chosen page after you log in.
