1👍
There is some error with your user_params due to which user is not being created and the control is passing down to else condition saying "status: :unprocessable_entity".
In order to fix it, run rails console:
RUN rails c
Copy your params that you have passed to rails api and try creating a user with those in the rails console. Or use binding.pry.
User.create(user_params)
This will highlight the errors in params. Hope this helps.
Source:stackexchange.com