【发布时间】:2022-10-23 15:53:12
【问题描述】:
我正在使用 grape_rails gem 来管理 API,在我的端点上我有以下内容:
..api/v4/endpoints/base.rb
class Endpoints::V4::Base < Endpoints::Base before { authenticate_with_token! } version 'v4', using: :path mount Endpoints::V4::Menu mount Endpoints::V4::Customer mount Endpoints::V4::Orders end我想跳过使用令牌进行身份验证!方法端点::V4::菜单在我的 base.rb 文件中,但它对我不起作用。
我已经尝试过:
class Endpoints::V4::Base < Endpoints::Base skip_before { authenticate_with_token! only: :customer } # first test before { authenticate_with_token! except: :customer } # second test ... def customer mount Endpoints::V4::Products end end谢谢你的时间
【问题讨论】:
标签: ruby-on-rails ruby ruby-grape