Available from version 1.11.0
Removed in version 1.33.0
Can cancel the login process
Define function:
public static function onAbortLogin( User $user, $password, LoginForm &$retVal, &$msg ) { ... }
Attach hook: In extension.json:
	"Hooks": {
		"AbortLogin": "MyExtensionHooks::onAbortLogin"
Called from: File(s): specials/SpecialUserLogin.php
Interface: AbortLoginHook.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)
  • &$msg: name of the error message displayed to the user (introduced in 1.18)


  • 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.