Skip to content

Commit 553a9c9

Browse files
authored
Merge pull request #27 from mjawad096/bugfix/csrf-token-mismatch
fixed bug "csrf token mismatch"
2 parents 780ad39 + b151847 commit 553a9c9

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/App/Editor/AssetManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class AssetManager
2020

2121
function __construct(AssetRepository $assetRepository)
2222
{
23-
$this->headers['_token'] = csrf_token();
23+
$this->headers['X-CSRF-TOKEN'] = csrf_token();
2424
$this->upload = $assetRepository->getUploadUrl();
2525
$this->uploadName = 'file';
2626

src/App/Editor/StorageManager.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,11 @@ class StorageManager
1212
public int $stepsBeforeSave = 10;
1313
public bool $autoload = false;
1414
public ?string $urlStore = null;
15-
16-
public $params = [
17-
'_token' => null
18-
];
15+
public array $headers = [];
1916

2017
function __construct($save_url = null)
2118
{
22-
$this->params['_token'] = csrf_token();
19+
$this->headers['X-CSRF-TOKEN'] = csrf_token();
2320

2421
$this->autosave = config('laravel-grapesjs.storage_manager.autosave', true);
2522
$this->stepsBeforeSave = config('laravel-grapesjs.storage_manager.steps_before_save', 10);

0 commit comments

Comments
 (0)