拥有 devise_for :users 使用户控制器的所有方法都通过 Devise 进行身份验证。我想跳过几个方法,例如users#api, users#do_stuff使用自己编写的身份验证方法制作公共 API。
我该怎么做?
更新。
skip_before_filter :authenticate_user!, only: [:api, :do_stuff]
Run Code Online (Sandbox Code Playgroud)
仍然给我 {"error":"You need to sign in or sign up before continuing."}
尝试这个 -
skip_before_filter :authenticate_user!, :only => [:api,:do_stuff]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10606 次 |
| 最近记录: |