aikvadrober / debuglogin
Login to any customer account with a single GET request. Local development only.
Package info
github.com/aikvadrober/DebugLogin
Type:magento2-module
pkg:composer/aikvadrober/debuglogin
Requires
- php: ^8.1
- magento/framework: ^103.0
- magento/module-customer: ^103.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Warning: This module is strictly intended for local development and debugging purposes only. Never deploy or enable it in a production environment. Use at your own risk.
One GET request logs you into a Magento 2 storefront as any customer. No passwords, no passkeys, no password-reset emails, no CAPTCHA guessing. Copy it into app/code, hit the URL, you are in - as admin, as QA, as the customer who reported the bug.
Why
Testing a customer-facing bug used to mean: reset the password, dig the reset link out of Mailtrap, guess the CAPTCHA, repeat for every store view. That is ten minutes of ceremony for one page view. AiKvadrober_DebugLogin replaces all of it with a single link you keep in your notes.
- Zero configuration: no admin settings, no customer attributes, no schema changes.
- Zero footprint: one controller, two XML files, no cron, no observers, no queues.
- Safe by default: hard-coded guards make it a silent 404 anywhere except a local dev host in developer mode.
Requirements
- Magento 2.4+ (
magento/framework ^103.0,magento/module-customer ^103.0) - PHP 8.1+
- Developer mode and a local host - otherwise the endpoint is a 404 (see Safety model)
Install
Via composer (once the package is on Packagist):
composer require aikvadrober/debuglogin
Or drop the module into a local Magento project:
# from the project root git clone <this-repo> app/code/AiKvadrober/DebugLogin bin/magento module:enable AiKvadrober_DebugLogin bin/magento setup:upgrade
Requires Magento_Customer (declared in etc/module.xml). No composer dependencies beyond core.
Usage
Login as a customer by email or by ID:
/debuglogin/index/index?email=a@b.c
/debuglogin/index/index?id=15
Land wherever the test needs you:
/debuglogin/index/index?email=a@b.c&redirect=customer/address
| Parameter | Meaning |
|---|---|
email |
Customer email, resolved on the current website (Controller/Index/Index.php) |
id |
Customer entity ID, takes precedence over email |
redirect |
Frontend path after login, validated against #^[a-z0-9_\-/]+$#i, defaults to customer/account |
An existing session is logged out first, then the customer is logged in and the session ID is regenerated.
Safety model
The controller bails out to a noroute forward unless both guards pass:
- Application mode is
developer(Magento\Framework\App\State::MODE_DEVELOPER). - The store base URL host matches
/(^localhost$|\.ddev\.site$|\.test$|\.local$)/.
Deploy it to staging or production and the URL is a plain 404. Still, this is a debug tool: keep it out of production trees anyway.
Files
Controller/Index/Index.php- the whole module: guards, lookup, login, redirectetc/frontend/routes.xml-debugloginfront nameetc/module.xml- module declaration, sequenceMagento_Customerregistration.php- component registrar