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).

Source | Google | Stack overflow

Edit

git clone [email protected]:plataformatec/devise.git

cd devise

open lib/devise/failure_app.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Devise--FailureApp-http_auth--for-pr


# Commit to git

git add lib/devise/failure_app.rbgit commit -m "better docs for Devise::FailureApp#http_auth?"


# Open pull request

gem 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!