我使用看門寶石門衛給401未授權
我的ApplicationController是這樣的:
private
def current_resource_owner
Person.find(doorkeeper_token.resource_owner_id) if doorkeeper_token
end
我DemosController是這樣的:
doorkeeper_for :index
respond_to :json
def index
respond_with current_resource_owner
end
響應就這樣產生了:
Started GET "/?code=f88d2e95b1b286645d31772c395e0e36708a5i0p970836af640f631bb4f043b5" for 127.0.0.1 at 2014-01-28 11:10:56 +0530
Processing by DemosController#index as HTML
Parameters: {"code"=>"f88d2e95b1b286645d31135c395e0e36708a5b5b970836af640f631bb4f043b5"}
Filter chain halted as #<Proc:[email protected]/home/xyz/.rvm/gems/[email protected]/gems/doorkeeper-1.0.0/lib/doorkeeper/helpers/filter.rb:8> rendered or redirected
Completed 401 Unauthorized in 1ms (ActiveRecord: 0.0ms)
你有解決這個問題嗎?我收到了同樣的錯誤。 –