Skip to content

Commit

Permalink
Specify an URL to redirect after logout via settings
Browse files Browse the repository at this point in the history
  • Loading branch information
kidhab committed Mar 29, 2023
1 parent 8420323 commit f360f76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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

0 comments on commit f360f76

Please sign in to comment.