1
railscast에서이 tutorial 다음에 내 레일 API에 대한 인증을 구현하려고합니다. 나는 블럭 안의 토큰을 검사해야하고 블록이 true를 반환하면 통과해야하는 메소드 authenticate_or_request_with_http_token
을 사용하고 있습니다. 그러나, 방금 블록에 진실이라고하더라도 방법은 결코 통과하지 않는다. 나는 레일 4.0authenticate_or_request_with_http_token이 절대 전달되지 않습니다
Filter chain halted as :restrict_access rendered or redirected
을 사용하고
이 내 코드입니다 : 이것은 내가 로그에서 볼 것입니다 당신은 인증 헤더를 제공해야 백엔드
before_filter :restrict_access
def restrict_access
authenticate_or_request_with_http_token do |token, options|
true
end
end