Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- before_filter :request_confirm, :only => [:delete_device]
- def request_confirm
- user = User.find_by_id(session[:user_id])
- authenticate_or_request_with_http_basic do |nick, pass|
- nick == user.nickname and pass == user.password
- end
- end
- authenticate_or_request_with_http_basic do |nick, pass|
- nick == user.nickname and pass == user.password
- end
- def authenticate_or_request_with_http_basic(realm = "Application", &login_procedure)
- authenticate_with_http_basic(&login_procedure) || request_http_basic_authentication(realm)
- end
Add Comment
Please, Sign In to add comment