devise
https://github.com/plataformatec/devise
Ruby
Flexible authentication solution for Rails with Warden.
Devise::FailureApp#http_auth?
Choose whether we should respond in a http authentication fashion, including 401 and optional headers. This method allows the user to explicitly disable http authentication on ajax requests in case they want to redirect on failures instead of handling the errors on their own. This is useful in case your ajax API is the same as your public API and uses a format like JSON (so you cannot mark JSON as a navigational format).
Edit
git clone [email protected]:plataformatec/devise.git
cd devise
open lib/devise/failure_app.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Devise--FailureApp-http_auth--for-pr
# Commit to gitgit add lib/devise/failure_app.rbgit commit -m "better docs for Devise::FailureApp#http_auth?"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Devise--FailureApp-http_auth--for-pr
hub pull-request
# Celebrate!