OnUserNotFound
Last updated Oct 14th, 2026 | Page history | Improve this page | Report an issue
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
Budget
$186 per month—let's make that $500!
Learn moreEvent: 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¶
- OnBeforeWebLogin || OnBeforeManagerLogin — a non-
trueoutput aborts the login with that message. - OnUserNotFound — runs only when the username is missing from the MODX database. A Plugin may supply its own
modUserto continue. - OnWebAuthentication || OnManagerAuthentication — overrides the default password check. A
trueoutput marks the user as verified and logged in. - 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
Budget
$186 per month—let's make that $500!
Learn more










