diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/auth_remote/init.php | 19 |
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; } |