I have a Rails 5 app with the Devise gem installed. My project is set up in such a way, that all controllers are namespaced...Even Devise controllers.
In my routes file I have done this(This will better explain my namespacing structure):
It seems to be that Devise is nested within the
:api_v1_public_members namespace in your routes.rb. In this case it affects not only on
authenticate_user! method, changing it into
authenticate_api_v1_public_members_user!, but on the others methods too.
current_user turns to
user_signed_in? turns to
There is similar problem here undefined method `authenticate_user! Api::PostsController in Devise / Rails 4