Jump to main content Jump to doc navigation

Event: OnUserNotFound

Fires when a user is not found during login. Use it for external authentication.

  • Service: 1 - Parser Service Events
  • Group: Users

Event Parameters

Name Description
user A reference to the modUser object, passed by reference. Return a modUser (or a class extending it) in the event output — directly or as one index of an array — or assign it here to continue the login.
username The specified username.
password The specified password.
attributes An array with:
- rememberme — Boolean set if the user wants the password to be remembered
- lifetime — the session cookie lifetime for this login
- loginContext — the context key this login is occurring in
- addContexts — additional contexts in which the login is also occurring

The lifetime, loginContext and addContexts values exist only inside the attributes array — they are not separate top-level parameters.

Event Login Workflow

  1. OnBeforeWebLogin || OnBeforeManagerLogin — a non-true output aborts the login with that message.
  2. OnUserNotFound — runs only when the username is missing from the MODX database. A Plugin may supply its own modUser to continue.
  3. OnWebAuthentication || OnManagerAuthentication — overrides the default password check. A true output marks the user as verified and logged in.
  4. OnWebLogin || OnManagerLogin — fires after the login has finished. It does not change the login outcome.

See Also

Support the team building MODX with a monthly donation.

The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.

Backers

  • modmore
  • STERC
  • Digital Penguin
  • Jens Wittmann – Gestaltung & Entwicklung
  • CrewMark
  • Fabian Christen
  • Sepia River Studios
  • Dannevang Digital
  • A. Moreno
  • Alex
  • Chris Fickling
  • Stéphane Jäggi
  • YJ
  • Murray Wood
  • JT Skaggs
  • Anton Tarasov
  • deJaya
  • Lefthandmedia
  • eydolan
  • Following Sea
  • Guido Gallenkamp
  • Raffy
  • Snow Creative
  • Nick Clark
  • Guest
  • Helen
  • krisznet
  • Yanni
  • Richard

Budget

$186 per month—let's make that $500!

Learn more