lib/generators/authentication/templates/controllers/api/password_resets_controller.rb.tt in authentication-zero-0.0.12 vs lib/generators/authentication/templates/controllers/api/password_resets_controller.rb.tt in authentication-zero-0.0.13
- old
+ new
@@ -14,11 +14,11 @@
render json: { error: "The email address doesn't exist in our database" }, status: :bad_request
end
end
def update
- if @<%= singular_table_name %>.update(password_params)
+ if @<%= singular_table_name %>.update(<%= "#{singular_table_name}_params" %>)
render json: @<%= singular_table_name %>
else
render json: @<%= singular_table_name %>.errors, status: :unprocessable_entity
end
end
@@ -28,9 +28,9 @@
@<%= singular_table_name %> = <%= class_name %>.find_signed!(params[:sid], purpose: "password_reset")
rescue ActiveSupport::MessageVerifier::InvalidSignature
render json: { error: "Your token has expired, please request a new one" }, status: :bad_request
end
- def password_params
+ def <%= "#{singular_table_name}_params" %>
params.permit(:password, :password_confirmation)
end
end