Skip to content

Commit

Permalink
Merge pull request #795 from ltb-project/issue-780-login-hint
Browse files Browse the repository at this point in the history
Use login_hint to prefill user login
  • Loading branch information
coudot authored Aug 18, 2023
2 parents a6c59cb + d3191b2 commit 76c96d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/config_general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,19 @@ Prefill user login
------------------

If Self Service Password is called from another application, you can
prefill the login but sending an HTTP header.
prefill the login by sending an HTTP header.

To enable this feature:
To enable this feature, configure the name of the HTTP header:

.. code-block:: php
$header_name_preset_login = "Auth-User";
It is also possible to prefill the login by using the ``login_hint``
GET or POST parameter. This method does not require any configuration.

Example: ``https://ssp.example.com/?actionresetbyquestions&login_hint=spiderman``

Captcha
-------

Expand Down
3 changes: 3 additions & 0 deletions htdocs/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
"filter_by_ip" => isset($ratelimit_filter_by_ip_jsonfile) ? $ratelimit_filter_by_ip_jsonfile : ""
);

# Preset login with login_hint
if (isset($_REQUEST["login_hint"]) and $_REQUEST["login_hint"]) { $presetLogin = strval($_REQUEST["login_hint"]); }

#==============================================================================
# Route to action
#==============================================================================
Expand Down

0 comments on commit 76c96d5

Please sign in to comment.