I installed the Two-factor Authentication (TFA) and the TFA Basic plugins modules.
I want to alter the value returned from tfa_basic_tfa_ready_require()
, which is a hook implementation, in a custom module.
/**
* Implements hook_tfa_ready_require().
*/
function tfa_basic_tfa_ready_require($account) {
if (tfa_basic_tfa_required($account)) {
drupal_set_message(t('Login disallowed. You are required to set up two-factor authentication. Please contact a site administrator.'), 'error');
return TRUE;
}
return FALSE;
}
I tried the following code in the custom_tfa.module file, but it does not work.
function custom_tfa_tfa_basic_tfa_ready_require_alter($account) {
drupal_set_message(t('TEST'), 'warning');
return FALSE;
}
How can I alter the value returned from a hook?
hook_tfa_ready_require
and your custom module is namedcustom_tfa
then your custom module needs to implementcustom_tfa_tfa_ready_require($account)
.Implements hook_tfa_ready_require().
says that is a hook implementation.