Guest User

Untitled

a guest
Mar 8th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. # products_controller.rb
  2. before_filter :authenticate
  3.  
  4. protected
  5.  
  6. def authenticate
  7. authenticate_or_request_with_http_basic do |username, password|
  8. case request.domain
  9. when "domain1.com"
  10. username == "foo1" && password == "bar"
  11. when "domain2.com"
  12. username == "foo2" && password == "bar"
  13. when "domain3.com"
  14. username == "foo3" && password == "bar"
  15. end
  16. end
Add Comment
Please, Sign In to add comment