From 9348367213f6546554b77183044df7433b3f2093 Mon Sep 17 00:00:00 2001 From: mildis Date: Wed, 2 Dec 2020 15:57:30 +0100 Subject: [PATCH] allow define custom logout uri Fixes #234 --- lib/Lufi/Controller/Auth.pm | 7 ++++++- lufi.conf.template | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/Lufi/Controller/Auth.pm b/lib/Lufi/Controller/Auth.pm index 7405694..9913cad 100644 --- a/lib/Lufi/Controller/Auth.pm +++ b/lib/Lufi/Controller/Auth.pm @@ -51,7 +51,12 @@ sub log_out { $c->logout; } } - $c->render(template => 'logout'); + + if ($c->config('logout_custom')) { + return $c->redirect_to($c->config('logout_custom')); + } else { + $c->render(template => 'logout'); + } } 1; diff --git a/lufi.conf.template b/lufi.conf.template index f89d376..778391d 100644 --- a/lufi.conf.template +++ b/lufi.conf.template @@ -101,6 +101,9 @@ # optional, no domains allowed by default #allowed_domains => ['http://1.example.com', 'http://2.example.com'], + # String of the URL to be redirected to when accessing /logout + #logout_custom => 'https://sso.example.com/logout?redirect_uri=https%3A%2F%2Ffiat-tux.fr', + # Define a path to the upload directory, where the uploaded files will be stored # You can define it relative to lufi directory or set an absolute path # Remember that it has to be in a directory writable by Lufi user