rails 응용 프로그램, 설정 포도를 사용하고 모든 끝점을 인증하려고합니다. 그래서 grape token auth https://github.com/mcordell/grape_token_auth을 시도하고 github 문서에서 설명한대로 설정하십시오. 이것들은 나의 구성입니다.포도 토큰 인증 "오류": "404 API 버전을 찾을 수 없음"
초기화/gta.rb이 폴더 구조를
app/api/tmo/api.rb -> mounted two version root file
app/api/tmo/vl/root.rb -> mounted all the other files for v1
app/api/tmo/vl/restaurants.rb -> here lies the mount authentication
include GrapeTokenAuth::MountHelpers
include GrapeTokenAuth::TokenAuthentication
mount_registration(to: '/auth', for: :user)
mount_sessions(to: '/auth', for: :user)
mount_token_validation(to: '/auth', for: :user)
mount_confirmation(to: '/auth', for: :user)
이다 API에 대한
GrapeTokenAuth.setup! do |config|
config.mappings = { user: User }
config.secret = 'aaa'
end
그래서 내 경로가 같은
Running via Spring preloader in process 9309
POST /auth/api/v1(/.:format)
DELETE /auth/api/v1(/.:format)
PUT /auth/api/v1(/.:format)
POST /auth/api/v1/sign_in(.:format)
DELETE /auth/api/v1/sign_out(.:format)
GET /auth/api/v1/validate_token(.:format)
GET /auth/confirmation/api/v1(/.:format)
GET /api/v1/statuses/public_timeline(.:format)
내가 액세스 할 때/API/V1/status/public_timeline이 401 인증을받지 못했음을 의미하므로 authenticate_user! 방법은
작업 있지만 내가 게시 할 때에/인증/API/V1 내가 얻을 오류가 발생되는 경우{
"error": "404 API Version Not Found"
}
는 어떻게 확인합니까 아니면 내가 이것을 어떻게 해결합니까 다음과 같은 오류?