Specify an URL to redirect after logout via settings (#989)

This commit is contained in:
kidhab 2023-03-30 10:05:47 +02:00 committed by GitHub
parent 67d0492ac4
commit c01c16ecdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -21,7 +21,11 @@ class SessionsController < ApplicationController
def destroy
logout
redirect_to login_url, :notice => I18n.t('sessions.logged_out')
if FoodsoftConfig[:logout_redirect_url].present?
redirect_to FoodsoftConfig[:logout_redirect_url]
else
redirect_to login_url, :notice => I18n.t('sessions.logged_out')
end
end
# redirect to root, going to default foodcoop when none given

View File

@ -32,6 +32,9 @@ default: &defaults
# custom foodsoft software URL (used in footer)
#foodsoft_url: https://github.com/foodcoops/foodsoft
# URL to redirect to after logging out
# logout_redirect_url: https://foodcoop.test
# Default language
#default_locale: en
# By default, foodsoft takes the language from the webbrowser/operating system.