You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've (finally) gotten minitest of doorkeeper before_action :doorkeeper_authorize! protected controllers by creating the user/oauth_application/access_token with all the proper fields working.
When I move to before_action :authenticate_user! with devise-doorkeeper, it fails with:
Expected response to be a <2XX: success>, but was a <401: Unauthorized>
Response body: {"error":"You need to sign in or sign up before continuing."}
The same controller code with authenticate_user! works fine outside the test. Is there anything else to consider in the testing? Or an example?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
You should use authenticate_user! or doorkeeper_authorize! but not both at the same time. Ideally you should use authenticate_user! only, but in my case (Rails API-only app) it was not working properly.
Is it working in development? I guess not. I had a problem with Devise not setting the winning_strategy. In this case, the Doorkeeper strategy is not being set as the winning strategy when the strategy fails. I solved it adding warden in my Gemfile pointing to master branch, where there is a fix for this. Check if this solves the problem.
HI there,
I've (finally) gotten minitest of doorkeeper
before_action :doorkeeper_authorize!
protected controllers by creating the user/oauth_application/access_token with all the proper fields working.When I move to
before_action :authenticate_user!
withdevise-doorkeeper
, it fails with:The same controller code with
authenticate_user!
works fine outside the test. Is there anything else to consider in the testing? Or an example?Thanks in advance!
The text was updated successfully, but these errors were encountered: