Permalink
Browse files

Allow to destroy a session using JSON format (or any non navigational…

… format) when Rails flash feature is not enabled (i.e.: when using rails-api).
  • Loading branch information...
1 parent 0c9b799 commit 8171ad39e0b653096b130e06361f12ef9abf9169 @mathieul mathieul committed Jun 23, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/controllers/devise/sessions_controller.rb
@@ -22,7 +22,7 @@ def create
def destroy
redirect_path = after_sign_out_path_for(resource_name)
signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name))
- set_flash_message :notice, :signed_out if signed_out
+ set_flash_message :notice, :signed_out if signed_out && is_navigational_format?
# We actually need to hardcode this as Rails default responder doesn't
# support returning empty response on GET request

0 comments on commit 8171ad3

Please sign in to comment.