下面是我用于测试的rspec代码, post api_user_registration_pathexpect(last_response.body).not_to have_content('error')附加信息:型号名称为'User‘,路由如下所示: scope :v1 do
mount_devise_token_
我正在c#中开发一个应用程序来访问CoinBase Api。在用户输入他们的凭据后,我从回调的api中得到一个代码。我将代码交换为access_token。我确实用access_token、token_type、refresh_token、expires_in、scope获得了一个令牌。所有内容都是从CoinBase中填充的。问题是,当我把access_token复制到邮递员中时,我就会得到invalid_token。下面是我打电话的方式:
A
我已经使用保护创建了代码和经过身份验证的用户,但是它没有提供给我一个api_token * This'll provide login authentication to the user'), 'data' => auth()->user()],200);上面的函数工作正常,但我使用auth()->guard('api')->user()->api_token时没有得到令牌。本专栏已经在我
如何在RSpec请求测试中传递API密钥?我的API键是在一个标题中发送的,所以我在web中像这样传递它:Value: Tokentoken="c32a29a71ca5953180c0a60c7d68ed9e) it "is authenticated with a token" do
put "/api/v1/users/#{@user