How do you have control (in this case deleting a cookie) after devise
has determined that a user has entered the wrong password in the
latest version of devise. I have my own custom failure app but cookies
are not accessible within it:

class CustomFailureApp < Devise::FailureApp

def respond
unless request.format.to_sym == :html
http_auth
else
store_location!
flash[:alert] = i18n_message

if request.subdomain == 'abc' && i18n_message.includes?
('Invalid login or password')
cookies.delete :tracker_for_external_clients


uri = URI('http://abc.com/?page_id=425')
params = { 'message' => i18n_message }
uri.query = URI.encode_www_form(params)

res = Net::HTTP.get_response(uri)

if res.is_a?(Net::HTTPSuccess)
Rails.logger.info "The response is #{res.body}"
else
Rails.logger.info "Something went wrong"
end

redirect_to redirect_url
end
end

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedFeb 27, '12 at 8:13p
activeFeb 27, '12 at 8:13p
posts1
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

John Merlino: 1 post

People

Translate

site design / logo © 2021 Grokbase