aboutsummaryrefslogtreecommitdiffstats
path: root/doc/en/hook/authenticate.bb
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-04-30 06:59:20 +0000
committerMario <mario@mariovavti.com>2024-04-30 06:59:20 +0000
commitce15852b9a57a6c77531186ed24a389ebce8524e (patch)
treead04cef0d545c5e5e24e76060b6c32d65363d48e /doc/en/hook/authenticate.bb
parent48cec945051d259a06871d937ad998a1bd3e22ec (diff)
parent7c34a3676d294c9a1acc69f71ab3061074509160 (diff)
downloadvolse-hubzilla-ce15852b9a57a6c77531186ed24a389ebce8524e.tar.gz
volse-hubzilla-ce15852b9a57a6c77531186ed24a389ebce8524e.tar.bz2
volse-hubzilla-ce15852b9a57a6c77531186ed24a389ebce8524e.zip
Merge branch 'rework-help-module' into 'dev'
Rework Help module + begin tests for Setup module See merge request hubzilla/core!2120
Diffstat (limited to 'doc/en/hook/authenticate.bb')
-rw-r--r--doc/en/hook/authenticate.bb29
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/en/hook/authenticate.bb b/doc/en/hook/authenticate.bb
new file mode 100644
index 000000000..eb8071e73
--- /dev/null
+++ b/doc/en/hook/authenticate.bb
@@ -0,0 +1,29 @@
+[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