Reputation:
I am installing Devise to deploy Login function on Rails API as backend.
I tried to post API request by Postman but gets the following error.
[Error Message] Unpermitted parameter: :format Filter chain halted as :validate_sign_up_params rendered or redirected
・Request (Postman): POST "http://localhost:3000/api/v1/auth"
・json { "username": "hogehoge", "email": "[email protected]", "password": "123456789" }
app / controllers / v1 / auth / registrations_controller.rb
module Api
module V1
module Auth
class RegistrationsController < DeviseTokenAuth::RegistrationsController
private
def sign_up_params
params.permit(:username, :email, :password)
end
def account_update_params
params.permit(:username, :email)
end
end
end
end
end
Upvotes: 0
Views: 471
Reputation:
On Postman, the format of sending data was just "Text", but changed to "JSON" like above, then the problem solved!
Upvotes: 1