Skip to content

Instantly share code, notes, and snippets.

@ak47
Last active December 19, 2015 05:49
Show Gist options
  • Save ak47/5906514 to your computer and use it in GitHub Desktop.
Save ak47/5906514 to your computer and use it in GitHub Desktop.
module Devise
module Strategies
class MyAuthenticatable < Authenticatable
def authenticate!
begin
if resp = authenticate_local
else
fail!('Invalid username or password')
end
rescue Error => e
redirect! weak_password_path
end
end
end
end
end
Warden::Strategies.add(:pf_authenticatable, Devise::Strategies::PfAuthenticatable)
@ak47
Copy link
Author

ak47 commented Jul 2, 2013

authenticate_local raises an exception, re-raising in rescue does not bubble up to Rails.

redirect! does not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment