1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hubzilla_ynh.git synced 2024-09-03 19:26:21 +02:00
hubzilla_ynh/sources/doc/hook/authenticate.bb
2015-11-15 13:51:39 -05:00

29 lines
1.1 KiB
Clojure

[h2]authenticate[/h2]
Invoked when a POST request is made with non-null $_POST['auth-params'] such as from the login form.
If the hook handler does not set the 'authenticated' parameter of the passed array, normal login functions continue;
The 'user_record' is in fact an account DB record. To provide automatic provisioning of accounts from other authentication realms, this record should be generated and stored during the verification phase.
[code]
$addon_auth = array(
'username' => trim($_POST['username']),
'password' => trim($_POST['password']),
'authenticated' => 0,
'user_record' => null
);
/**
*
* A plugin indicates successful login by setting 'authenticated' to non-zero value and returning a user record
* Plugins should never set 'authenticated' except to indicate success - as hooks may be chained
* and later plugins should not interfere with an earlier one that succeeded.
*
*/
call_hooks('authenticate', $addon_auth);
[/code]
See include/auth.php