octobercms/october · error · ValidationException

A user could not be found with a login value of ':login'

Error message

A user could not be found with a login value of ':login'

What it means

Guard in Auth::handleSubmitRestore for the case where BackendAuth::findUserByLogin cannot find a user matching the submitted login value. Per the security comment, the failure is deliberately handled without revealing whether the account exists (anti-enumeration), and the surrounding rate limiting limits probing; the raw 'user not found' condition is only meaningful internally.

Solutions

  1. Verify the login value (username/email) is spelled correctly and belongs to an existing backend user
  2. If developing locally, check the user record exists in the backend_users table
  3. Note that responses are intentionally uniform to prevent account enumeration
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at modules/backend/controllers/Auth.php:200 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/de1c5ba1ce7c9d30. Report an issue: GitHub.

Appendix: source

Thrown at modules/backend/controllers/Auth.php:200

        }

        // Throttle reset requests by IP to limit email flooding and slow
        // username enumeration via timing analysis.
        $limiter = new RateLimiter('backend.auth.restore');
        if ($limiter->tooManyAttempts(5)) {
            throw new ApplicationException(__("Too many password reset attempts, please try again in :seconds seconds.", [
                'seconds' => $limiter->availableIn()
            ]));
        }

        $limiter->increment(600);

        $user = BackendAuth::findUserByLogin(post('login'));

        if (!$user) {
            // For security reasons, only show detailed error when debug mode is on
            if (System::checkDebugMode()) {
                throw new ValidationException([
                    'login' => __("A user could not be found with a login value of ':login'", ['login' => post('login')])
                ]);
            }
        }
        else {
            // User found, send reset email
            $code = $user->getResetPasswordCode();
            $link = Backend::url('backend/auth/reset/' . $user->id . '/' . $code);

            $data = [
                'name' => $user->full_name,
                'link' => $link,
            ];

            Mail::send('backend:restore', $data, function ($message) use ($user) {
                $message->to($user->email, $user->full_name)->subject(__('Password Reset'));
            });
        }

View on GitHub (pinned to b608633a7e)