| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Auth\Hook; |
| 4 | |
| 5 | /** |
| 6 | * This is a hook handler interface, see docs/Hooks.md. |
| 7 | * Use the hook name "AuthPreserveQueryParams" to register handlers implementing this interface. |
| 8 | * |
| 9 | * @unstable to implement |
| 10 | * @ingroup Hooks |
| 11 | */ |
| 12 | interface AuthPreserveQueryParamsHook { |
| 13 | /** |
| 14 | * This hook gets called any time an authentication page generates an URL which |
| 15 | * is in some sense part of the authentication process (e.g. a language switcher |
| 16 | * link, the login form's action URL, or the return URL for a remote identity provider) |
| 17 | * and needs to determine which of the current query parameters to preserve in that URL. |
| 18 | * |
| 19 | * @since 1.43 |
| 20 | * |
| 21 | * @param array &$params Query parameters to preserve, name => value |
| 22 | * @param array $options Information about the purpose of the URL that's being generated |
| 23 | * - reset (bool, default false): Reset the authentication process, i.e. omit |
| 24 | * parameters which are related to continuing in-progress authentication. |
| 25 | * This is used e.g. in the link for switching from the login form to the |
| 26 | * signup form. |
| 27 | * |
| 28 | * @return bool|void True or no return value to continue or false to abort |
| 29 | */ |
| 30 | public function onAuthPreserveQueryParams( array &$params, array $options ); |
| 31 | } |