File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
app/controllers/better_together Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -161,8 +161,17 @@ def store_user_location!
161161 store_location_for ( :user , request . fullpath )
162162 end
163163
164- def after_sign_in_path_for ( resource_or_scope )
165- stored_location_for ( resource_or_scope )
164+ def after_sign_in_path_for ( resource )
165+ stored_location_for ( resource ) ||
166+ if resource . permitted_to? ( 'manage_platform' )
167+ host_dashboard_path
168+ else
169+ BetterTogether . base_path_with_locale
170+ end
171+ end
172+
173+ def after_sign_out_path_for ( resource_or_scope )
174+ BetterTogether . base_path_with_locale
166175 end
167176 end
168177end
Original file line number Diff line number Diff line change @@ -5,6 +5,13 @@ module Users
55 class SessionsController < ::Devise ::SessionsController # rubocop:todo Style/Documentation
66 include DeviseLocales
77 skip_before_action :check_platform_privacy
8+
9+ def respond_to_on_destroy
10+ respond_to do |format |
11+ format . all { head :no_content }
12+ format . any ( *navigational_formats ) { redirect_to after_sign_out_path_for ( resource_name ) , status : :see_other }
13+ end
14+ end
815 end
916 end
1017end
You can’t perform that action at this time.
0 commit comments