Skip to content

Commit 0c387fe

Browse files
committed
Add fallback to main_app's logout_path if not using Devise.
1 parent f420baa commit 0c387fe

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/helpers/rails_admin/application_helper.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@ def edit_user_link
3131
end
3232

3333
def logout_path
34-
return unless defined?(Devise)
35-
scope = Devise::Mapping.find_scope!(_current_user)
36-
main_app.send("destroy_#{scope}_session_path") rescue false
34+
if defined?(Devise)
35+
scope = Devise::Mapping.find_scope!(_current_user)
36+
main_app.send("destroy_#{scope}_session_path") rescue false
37+
else
38+
main_app.logout_path if main_app.respond_to?(:logout_path)
39+
end
3740
end
3841

3942
def wording_for(label, action = @action, abstract_model = @abstract_model, object = @object)

0 commit comments

Comments
 (0)