Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify an URL to redirect after logout via settings #989

Merged
merged 1 commit into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ def create

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
Expand Down
3 changes: 3 additions & 0 deletions config/app_config.yml.SAMPLE
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down