Created
February 24, 2009 21:33
-
-
Save bradediger/69798 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def login_required | |
authorized? || access_denied | |
end | |
def access_denied | |
respond_to do |format| | |
format.html do | |
store_location | |
redirect_to new_session_path | |
end | |
# format.any doesn't work in rails version < http://dev.rubyonrails.org/changeset/8987 | |
# you may want to change format.any to e.g. format.any(:js, :xml) | |
format.any do | |
request_http_basic_authentication 'Web Password' | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment