Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.34 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. rails devise only allow existing users to register new users?
  2. before_filter :authenticate_homol
  3.  
  4. def authenticate_homol
  5.   if (Rails.env == 'staging') # for example
  6.     authenticate_or_request_with_http_basic do |username, password|
  7.       username == "login" && password == "123456"
  8.     end
  9.     warden.custom_failure! if performed?
  10.   end
  11. end