Due to the nature of your error, I assume that authenticate_user is called part of the create action.
If so, I believe that the answer I provided here will also help you.
Assuming, however, that this is part of creating an authenticated session, that is, there is no actual location for the newly created โresource,โ I would set zero for the location of the response, as in:
... respond_with(error, :status => 401, :location => nil) ...
This will make more sense if you look at the related answer. If this still does not make sense, I will be happy to clarify.
Aubergine
source share