[4.x]: /admin wrong password results in undefined error
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
What happened?
Description
So on a site if you try to login into the cms and you enter a faulty password you get the undefined error:
We do have a custom login url here instead of /admin however changing this has no effect.
Our general.php looks like this:
return GeneralConfig::create()
->limitAutoSlugsToAscii()
->convertFilenamesToAscii()
->enableGql(false)
// Prevent generated URLs from including "index.php"
->omitScriptNameInUrls()
->useEmailAsUsername()
// Set the default week start day for date pickers (0 = Sunday, 1 = Monday, etc.)
->defaultWeekStartDay(1)
// Enable Dev Mode
->devMode(App::env('DEV_MODE') ?? false)
// Allow administrative changes
->allowAdminChanges(App::env('ALLOW_ADMIN_CHANGES') ?? false)
// Allow updates
->allowUpdates(App::env('ALLOW_UPDATES') ?? false)
->userSessionDuration(7200)
// Disallow robots
->disallowRobots(App::env('DISALLOW_ROBOTS') ?? true)
->cpTrigger('prodelta-admin')
->aliases([
'@assetBaseUrl' => getenv('ASSET_BASE_URL'),
'@assetBasePath' => getenv('ASSET_BASE_PATH'),
'@baseUrl' => getenv('PRIMARY_SITE_URL'),
'@web' => getenv('PRIMARY_SITE_URL'),
'@basePath' => getenv('BASE_PATH'),
'@systemEmail' => getenv('SYSTEM_EMAIL'),
'@recaptchaKey' => getenv('RECAPTCHA_KEY'),
'@recaptchaSecretKey' => getenv('RECAPTCHA_SECRET_KEY'),
'@gtagKey' => getenv('GTAG_KEY'),
'@lazyloadPlaceholder'=> "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
]);
Steps to reproduce
- Enter a wrong password in /admin (I'm guessing this is a server issue, in the requirements overview everything is checked)
Expected behavior
Return the error that either the username or password is invalid
Actual behavior
Returning an undefined error.
Craft CMS version
4.5.6.1
PHP version
8.1.22
Operating system and version
No response
Database type and version
mysqlnd 8.1.22
Image driver and version
No response
Installed plugins and versions
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the wrong-password login at the configured custom admin trigger, prodelta-admin, using Craft CMS 4.5.6.1 and PHP 8.1.22, then trace where the undefined error is produced. Done means invalid credentials consistently return a clear username-or-password error instead of an undefined error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100