Jump to: navigation, search
Available from version 1.10.0
Can cancel the login process
Define function:
public static function onAbortLogin( $user, $password, &$retval ) { ... }
Attach hook:
$wgHooks['AbortLogin'][] = 'MyExtensionHooks::onAbortLogin';
Called from: File(s): SpecialUserlogin.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:AbortLogin extensions.


  • $user: User object being authenticated against
  • $password: password being submitted (before validity checks)
  • &$retval: a LoginForm class constant to return from authenticateUserData (default is LoginForm::ABORTED)


  • Can be used to allow an extension (for example, a captcha) to abort the login process
  • For &$retval, note that client may be using a machine API rather than the HTML user interface.


From MediaWiki 1.27 on, the hook is deprecated and superseded by AuthManager functionality. Any logic in it should probably be moved to a class implementing PreAuthenticationProvider, into the testForAuthentication method.