I use to develop an authentication token to authenticate some parts of my rails application. But when I try to create a new user from the registration path, he gives me the following error {"errors":["Authorized users only."]} .
Here is the rspec code I'm using for the test,
it 'creates a user using email/password combo' do post api_user_registration_path, { email: 'xxx', password: 'yyy',password_confirmation: 'yyy'} puts last_response.body expect(last_response.body).not_to have_content('error') end
Additional information: the model name is βUserβ and the routes look like
namespace :api do scope :v1 do mount_devise_token_auth_for 'User', at: 'auth' end end
I understand that the developer expects the user to be authenticated before accessing this path, but this is user registration, it must be out of authentication. Can you suggest a solution for this? Is there any configuration that I am missing here?
source share