Allow idempotent API requests, closes #1309.

This commit is contained in:
José Valim
2011-09-29 11:35:18 +02:00
parent 15b76e93d1
commit bc8fc2d4e4
2 changed files with 17 additions and 0 deletions

View File

@@ -91,6 +91,7 @@ MESSAGE
# Example:
# before_filter :require_no_authentication, :only => :new
def require_no_authentication
return unless is_navigational_format?
no_input = devise_mapping.no_input_strategies
args = no_input.dup.push :scope => resource_name
if no_input.present? && warden.authenticate?(*args)