dedoc / scramble

Modern Laravel OpenAPI (Swagger) documentation generator. No PHPDoc annotations required.
https://scramble.dedoc.co/
MIT License
1.18k stars 112 forks source link

fix: use decodeURIComponent instead of decodeURI to support sanctum csrf #548

Closed ritenn closed 1 week ago

ritenn commented 1 week ago

As stated in last post here: https://github.com/dedoc/scramble/pull/336, decodeURIComponent should be used instead of decodeURI, because decodeURI doesn't decode '%3D' (last 3 characters) and CSRF validation in Laravel doesn't pass. Updated locally to decodeURIComponent and requests works perfectly :)

For now workaround is to: php artisan vendor:publish --provider="Dedoc\Scramble\ScrambleServiceProvider" --tag="scramble-views"

and override it there, but it would be better to have it out of box.

romalytvynenko commented 1 week ago

@ritenn thank you!