Guest User

Untitled

a guest
Nov 17th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. module MyApplication
  2. class Application < Rails::Application
  3. config.to_prepare do
  4. Refinery::PagesController.class_eval do
  5. before_filter :require_auth, :only => [:show]
  6. def require_auth
  7. if params[:id] == 'secret-page'
  8. authenticate_or_request_with_http_basic('Administration') do |username, password|
  9. username == 'admin' && password == 'password'
  10. end
  11. end
  12. end
  13. protected :require_auth
  14. end
  15. end
  16. end
  17. end
Add Comment
Please, Sign In to add comment