0
class CustomFailureApp < Devise::FailureApp
# You need to override respond to eliminate recall
def respond
  if http_auth?
    http_auth
  else
    if request.format == "application/json"
      self.status = 401 
      self.content_type = "json"
      self.headers['WWW-Authenticate']="Please Confirm Your Account To Continue"
      self.response_body = {error: I18n.t("devise.failure.inactive")}.to_json
    else
      redirect          
    end
  end
end
end

whenever the user is unconfirmed spree_auth_devise respond with unauthorized which is handled by my custom failure app but the response object received by the ios app is empty. ios app is using AFNetworking and is updated to latestmaster I can't get what I am doing wrong.

Aleksei Matiushkin
  • 119,336
  • 10
  • 100
  • 160
Rastee
  • 73
  • 1
  • 6

1 Answers1

0

I found out that there is nothing wrong with this code , on the contrary the ios response handler was faulty.

Rastee
  • 73
  • 1
  • 6