Permalink
Browse files

Be sure to halt on failures, closes #856

  • Loading branch information...
1 parent 43a3431 commit 392e664036b462c5c45562c4aac34372d05e0af4 @josevalim josevalim committed Feb 24, 2011
View
@@ -16,6 +16,7 @@
* Custom failure apps no longer ignored in test mode (by github.com/jaghion)
* Do not depend on ActiveModel::Dirty
* Manual sign_in now triggers remember token
+ * Be sure to halt strategies on failures
* deprecations
* Deprecated anybody_signed_in? in favor of signed_in? (by github.com/gavinhughes)
@@ -21,6 +21,7 @@ def validate(resource, &block)
case result
when String, Symbol
fail!(result)
+ false
when TrueClass
decorate(resource)
true
@@ -10,7 +10,7 @@ def authenticate!
if validate(resource){ resource.valid_password?(password) }
resource.after_database_authentication
success!(resource)
- else
+ elsif !halted?
fail(:invalid)
end
end
@@ -20,7 +20,7 @@ def authenticate!
if validate(resource)
success!(resource)
- else
+ elsif !halted?
cookies.delete(remember_key)
pass
end
@@ -20,7 +20,7 @@ def authenticate!
if validate(resource)
resource.after_token_authentication
success!(resource)
- else
+ elsif !halted?
fail(:invalid_token)
end
end

0 comments on commit 392e664

Please sign in to comment.