Magento 2 force login: shop for signed-in customers only
SKU: FORCELOGIN1
- Login required for the whole shop or selected areas
- Exception list with imprint, privacy and password reset prefilled
- Return to the requested page after sign-in
- Per store view and customer group
Einmaliger Kauf · inkl. 12 Monate Updates · zzgl. MwSt.
Magento 2 force login: a closed shop with clear rules
With Mironsoft Force Login you use Magento 2 force login to switch off access for visitors who are not signed in. When someone opens a locked page, the module redirects to the login page, shows a notice and returns the customer to the originally requested page after sign-in. That gives you a closed reseller shop without hiding pages one by one.
The typical use is B2B: prices and range are meant for vetted business customers only. Shops that use Magento 2 force login often combine the login requirement with customer approval, so new customers can register but order only after your review. The module itself only checks whether someone is signed in.
The extension is built for Hyvä Themes, works server-side and needs no additional JavaScript. We set it up in your shop and create the exception list together with you.
Access only for customers you know
For reseller shops and price lists that must not be public: Magento 2 force login with clear exceptions and a clean return.
Whole shop or areas
Lock everything or only URL areas, categories and product groups.
Prefilled exceptions
Login, registration, password reset, imprint, privacy and terms stay reachable.
Custom exception list
Add further paths, pages and files via URL patterns.
Return after login
Whoever opens a product page lands there after signing in, not on the home page.
Notice text
An explanatory text above the login form, in its own language per store view.
API and cron untouched
Interfaces, cron calls and payment callbacks are not redirected.
Magento 2 force login for the whole shop or for areas
In the simplest case you lock the entire shop. It gets finer with areas: you choose URL patterns, categories or product groups that are reachable only after sign-in. A reseller area under /resellers can be locked while the rest of the shop stays public.
Search, sitemap output and product suggestions respect the lock too, so locked content does not become visible through detours. Search engines see the login page for locked areas.
- Entire shop or chosen URL patterns
- Categories and product groups as an area
- Adjustable per website and store view
Exception list: what stays reachable without login
A login requirement must not lock out mandatory pages. Login, registration, password reset, imprint, privacy policy and terms are therefore prefilled. You add further exceptions as a path or pattern, for example a contact page, the cancellation policy or robots.txt.
Payment callbacks, webhooks, API routes and cron calls are exempt as a rule, because a redirect would disrupt payments and interfaces. For legal reasons you should keep the imprint accessible; the module does not replace legal advice.
- Prefilled mandatory pages
- Custom paths and patterns with wildcards
- Technical paths (API, cron, callbacks) free automatically
Login page, notice text and return
Visitors are redirected with a 302, not a 301, so no permanent redirect settles in search engines or browsers. The login page carries noindex. The notice text explains why the page is protected and how to get access.
After a successful sign-in, the return leads back to the originally requested address, parameters included. The target is validated so that foreign addresses cannot be abused as a return destination.
- 302 redirect, noindex on the login page
- Notice text per store view
- Return target checked against open redirects
Login requirement by customer group and store view
The lock can be limited to individual store views, for example only the reseller store while the consumer store stays open. You can also define which customer groups have access after login. Everyone else sees a notice page with a contact option.
Interplay with the full page cache is accounted for: the check happens before protected pages are delivered, so signed-in visitors do not see cached guest pages and vice versa.
- Lock per website and store view
- Permitted customer groups selectable
- Notice page for groups without access
When Magento 2 force login makes sense
Reseller and wholesale shop
Prices and terms are not meant for the public. Magento 2 force login ensures that only registered resellers see them.
Internal staff or club shop
Merchandise or workwear for a closed group who sign in with credentials.
Early access and test phase
Before the public launch, selected customers review the shop. After launch you switch Magento 2 force login off again.
Locked price lists
Only one area, such as price lists and datasheets, is protected while the rest of the shop stays open.
Without the module versus Magento 2 force login
| Criterion | Without the module | With Force Login |
|---|---|---|
| Access to the shop | Public, prices visible | After sign-in, configurable per area |
| Mandatory pages | Must be checked one by one | Prefilled exceptions |
| Return after login | Home page | Requested page |
| Notice for visitors | None | Text per store view |
| Technical paths | Risk of misconfiguration | API, cron and callbacks free |
| Maintenance | Lock individual pages | Central rules |
How we set up Magento 2 force login in your shop
1. Define areas
We clarify whether the shop or only areas are locked.
2. Check exceptions
We go through mandatory pages, payment paths and interfaces together.
3. Installation
We install the module and set notice text and target pages.
4. Test as guest and customer
Check with and without sign-in, including return, then handover.
How it differs from related Mironsoft modules
CMS Page Restriction
Locks individual CMS pages and blocks by customer group. Magento 2 force login applies to the shop, categories and URL areas instead.
Restrict Products by Customer Group
Hides individual products per group. Force Login ties access as a whole to a sign-in.
Customer Approval
Checks approval of new accounts. In combination: registration, approval, then access behind the login requirement.
No download — personal setup instead
Force Login is not offered here as a download file for self-installation. The purchase is a service commission: we install the module in your shop and define areas, exception list and notice texts together with you.
Frequently asked questions
Everything about locking, exceptions, search engines and how the purchase works.
How can I open a Magento 2 shop to logged-in customers only?
Can I lock selected areas only with Magento 2 force login?
Do imprint and privacy policy stay reachable?
What do search engines see on locked pages with Magento 2 force login?
How can I return to the requested page after login in Magento 2?
Are payments and interfaces disrupted?
Can I control the lock by customer group?
Does the module work with Hyvä Themes?
Can I download and install the module myself?
Magento 2 force login – Mironsoft