When sending REST parameters as a JSON object together with a Content-Type: json instead of multipart/form-data, then the device parameter is not handled; i.e., the device is not registered and does not appear in the user account.
Cause
The code directly accesses $_POST['device'] instead of retrieving the request parameter from WP_REST_Request.
Discovered during #33
Problem
Content-Type: json
instead ofmultipart/form-data
, then thedevice
parameter is not handled; i.e., the device is not registered and does not appear in the user account.Cause
$_POST['device']
instead of retrieving the request parameter fromWP_REST_Request
.