diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index 85f1cc8ad3ae1b74e997d1275f4a029163090e29..9a66829d5c2acede474f8a3c9557a7b0dc39854c 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -267,4 +267,11 @@ Devise.setup do |config|
   # When using OmniAuth, Devise cannot automatically set OmniAuth path,
   # so you need to do it manually. For the users scope, it would be:
   # config.omniauth_path_prefix = '/my_engine/users/auth'
+
+
+  # If using rails-api, you may want to tell devise to not use ActionDispatch::Flash
+  # middleware b/c rails-api does not include it.
+  # See: http://stackoverflow.com/q/19600905/806956
+  config.navigational_formats = [:json]
+
 end