OblikStudio / kirby-git

Kirby plugin for updating content in the panel via Git
MIT License
84 stars 6 forks source link

500 error when visiting plugin page in panel #27

Open ericpedia opened 2 years ago

ericpedia commented 2 years ago

First off, I'm very excited about the plugin. Thank you for building it! It's so well thought out, and I can't wait to start using it.

Issue: When I visit the plugin page (/panel/git), console shows two 500 errors on the API requests, resulting in a non-working page showing an empty dialog (see screenshots).

About my installation:

This is the error response when I visit the API routes directly:

{"status":"error","message":"Unauthenticated","code":403,"exception":"Kirby\\Exception\\PermissionException","key":"error.permission","file":"\/kirby\/config\/api\/authentication.php","line":14,"details":[],"route":"git\/status"}

Any advice?

image image
hdodov commented 2 years ago

You get the "Unauthenticated" error when you visit the routes directly because you need to pass in a CSRF token along with the request, so that's expected to not work.

I have a website running with almost the same versions:

Maybe there was a breaking change in PHP 8.1.*? I don't have time at the moment to switch PHP versions and test.

You could use Xdebug and configure it to stop when it encounters and exception (which is what's happening, judging by your second screenshot). Maybe then, you could find where that exception is thrown.