opcodesio / log-viewer

Fast and beautiful Log Viewer for Laravel
https://log-viewer.opcodes.io
MIT License
3.39k stars 237 forks source link

Api stateful domains config option #354

Closed gdebrauwer closed 3 months ago

gdebrauwer commented 3 months ago

In a project that runs on 2 domains, I had an issue where the log-viewer API calls failed and caused an 'this action is unauthorized' on the secondary domain. After some digging, I found that I needed to set the sanctum.stateful config option. The problem is that my project does not use Sanctum. I had to create a dummy sanctum.php config to create and set that config variable.

That's why I propose to make that an option in the log-viewer config so that it can be easily customized even when you don't use Sanctum in your project.

I made the change a non-breaking change by still checking and using config('sanctum.stateful') if the config('log-viewer.api_stateful_domains') is not set.

arukompas commented 3 months ago

Big thanks @gdebrauwer , this makes perfect sense!

Tagged a new release - https://github.com/opcodesio/log-viewer/releases/tag/v3.7.0