For bug reporting only! If you're posting a feature request or discussion, please ignore.
Expected Behavior
Try to pass data to the backend by doing simple POST request, and save data into the database.
Current Behavior
When I did the POST request, I keep getting 403 error response.
Failure Information
Keep getting 403 error response from the POST request.
Steps to Reproduce
Create an Axios POST request to the backend. For example the code below:
async function saveData(){
await axios.post('/savedata', {
headers: { Authorization: Bearer ${window.sessionToken}},
params: {info: "test"}
}).then (function(response){
console.log(response);
}).catch(function(error){
console.log(error);
});
}
In web.php, I have below route to handle the POST request:
Route::post('/savedata', 'MainController@store')->middleware(['verify.shopify']);
Inside the controller, I use Accessing API for the current shop to do a test response by returning $shop variable.
class MainController extends Controller{
public function store(Request $request)
{
$shop = Auth::user();
return $shop;
}
}
I keep getting 403 errors from the frontend response.
Context
Package Version: v17.0
Laravel Version: v7.30.4
PHP Version: v8.0.15
Failure Logs
Error: Request failed with status code 403
at createError (app.js:61851:15)
at settle (app.js:62112:12)
at XMLHttpRequest.handleLoad (app.js:61320:7)
For bug reporting only! If you're posting a feature request or discussion, please ignore.
Expected Behavior
Try to pass data to the backend by doing simple POST request, and save data into the database.
Current Behavior
When I did the POST request, I keep getting 403 error response.
Failure Information
Keep getting 403 error response from the POST request.
Steps to Reproduce
Create an Axios POST request to the backend. For example the code below: async function saveData(){ await axios.post('/savedata', { headers: { Authorization:
Bearer ${window.sessionToken}
}, params: {info: "test"} }).then (function(response){ console.log(response); }).catch(function(error){ console.log(error); }); }In web.php, I have below route to handle the POST request: Route::post('/savedata', 'MainController@store')->middleware(['verify.shopify']);
Inside the controller, I use Accessing API for the current shop to do a test response by returning $shop variable. class MainController extends Controller{ public function store(Request $request) { $shop = Auth::user(); return $shop; } }
I keep getting 403 errors from the frontend response.
Context
Failure Logs
Error: Request failed with status code 403 at createError (app.js:61851:15) at settle (app.js:62112:12) at XMLHttpRequest.handleLoad (app.js:61320:7)