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.