Merge "Stats: clarify TimingMetric::observe() units and discourage in new code"
[mediawiki.git] / includes / auth / Hook / AuthPreserveQueryParamsHook.php
blobcae4a7062bf87868897d8872e2fed367fc181695
1 <?php
3 namespace MediaWiki\Auth\Hook;
5 /**
6 * This is a hook handler interface, see docs/Hooks.md.
7 * Use the hook name "AuthPreserveQueryParams" to register handlers implementing this interface.
9 * @unstable to implement
10 * @ingroup Hooks
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.
19 * @since 1.43
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.
28 * @return bool|void True or no return value to continue or false to abort
30 public function onAuthPreserveQueryParams( array &$params, array $options );