You are here

function hook_disable_login_key_alter in Disable Login Page 1.0.x

Alter the secret key to allow login page access.

This hook is called when a user tries to access the /user/login page.

You can implement this hook to alter the value of the secret key used to allow access to the /user/login page when the Disable Login module is enabled on the site.

Parameters

string $secret: The secret key to be used.

2 invocations of hook_disable_login_key_alter()
DisableLoginAccessCheck::hasValidSecretToken in src/Access/DisableLoginAccessCheck.php
Check if the URL has a valid secret token.
SettingsForm::buildForm in src/Form/SettingsForm.php
Form constructor.

File

./disable_login.api.php, line 25
Hooks related to the Disable Login module.

Code

function hook_disable_login_key_alter(&$secret) {

  // You can build your custom logic to set the secret key here.
  $secret = 'altered-secret-key-value';
}