Make API route detection independent of real URL path (fixes #2977)

This commit is contained in:
Bernd Bestel 2026-08-30 11:11:37 +02:00
parent d9889fd157
commit 020841117f
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 2 additions and 2 deletions

View File

@ -54,4 +54,4 @@
### API
- xxx
- Fixed that API Key Authentication did not work when running Grocy in a subdirectory

View File

@ -122,7 +122,7 @@ abstract class BaseAuthMiddleware extends BaseMiddleware
protected function IsApiRoute(Request $request): bool
{
return string_starts_with($request->getUri()->getPath(), '/api/');
return string_starts_with(RouteContext::fromRequest($request)->getRoute()->getPattern(), '/api/');
}
/**