summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-12-06 13:20:18 +0300
committerAndrew Dolgov <[email protected]>2021-12-06 13:20:18 +0300
commit53061d150814cf5939d1d4dc165d8270ca764109 (patch)
tree5fd1b2c095dd54291d45cc9cb48037f021165c44 /plugins
parent57b0413a3a8b8f73276382d51cf560c09ac6fbc6 (diff)
* add HOOK_POST_LOGOUT
* auth_remote: add config option AUTH_REMOTE_POST_LOGOUT_URL
Diffstat (limited to 'plugins')
-rw-r--r--plugins/auth_remote/init.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/plugins/auth_remote/init.php b/plugins/auth_remote/init.php
index 9c15d3368..3203d41fe 100644
--- a/plugins/auth_remote/init.php
+++ b/plugins/auth_remote/init.php
@@ -1,15 +1,26 @@
<?php
class Auth_Remote extends Auth_Base {
+ /** redirect user to this URL after logout; .env:
+ * TTRSS_AUTH_REMOTE_POST_LOGOUT_URL=http://127.0.0.1/logout-redirect
+ */
+ const AUTH_REMOTE_POST_LOGOUT_URL = "AUTH_REMOTE_POST_LOGOUT_URL";
+
function about() {
return array(null,
- "Authenticates against remote password (e.g. supplied by Apache)",
+ "Authenticates against external passwords (HTTP Authentication, SSL certificates)",
"fox",
true);
}
function init($host) {
$host->add_hook($host::HOOK_AUTH_USER, $this);
+
+ Config::add(self::AUTH_REMOTE_POST_LOGOUT_URL, "", Config::T_STRING);
+
+ if (Config::get(self::AUTH_REMOTE_POST_LOGOUT_URL) != "") {
+ $host->add_hook($host::HOOK_POST_LOGOUT, $this);
+ }
}
function get_login_by_ssl_certificate() : string {
@@ -73,6 +84,12 @@ class Auth_Remote extends Auth_Base {
return false;
}
+ function hook_post_logout($login, $user_id) {
+ return [
+ Config::get(self::AUTH_REMOTE_POST_LOGOUT_URL)
+ ];
+ }
+
function api_version() {
return 2;
}