Fix dropped auth.service middleware alias breaking service APIs
Deploy Ladill Transfer / deploy (push) Successful in 32s
Deploy Ladill Transfer / deploy (push) Successful in 32s
Middleware::alias() replaces the alias map rather than merging, so the
second alias() call (platform.session, added in d491130) silently
removed the auth.service alias. Every service-to-service route
(auth.service:transfer) then failed with "Target class [auth.service]
does not exist", returning 500 to webmail/mobile for Transfer file
listing and uploads. Merge both aliases into a single alias() call.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
d491130b14
commit
4a4024799c
+4
-3
@@ -16,15 +16,16 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
$middleware->redirectGuestsTo(fn (Request $request) => route('sso.connect', [
|
||||
'redirect' => $request->fullUrl(),
|
||||
]));
|
||||
// NOTE: Middleware::alias() REPLACES the alias map (it is not additive), so every alias must be
|
||||
// registered in a single call. Splitting these into two alias() calls drops 'auth.service' and
|
||||
// breaks all service-to-service routes (auth.service:transfer) with "Target class does not exist".
|
||||
$middleware->alias([
|
||||
'auth.service' => \App\Http\Middleware\AuthenticateService::class,
|
||||
'platform.session' => \App\Http\Middleware\EnsurePlatformSession::class,
|
||||
]);
|
||||
$middleware->web(append: [
|
||||
\App\Http\Middleware\SetActingAccount::class,
|
||||
]);
|
||||
$middleware->alias([
|
||||
'platform.session' => \App\Http\Middleware\EnsurePlatformSession::class,
|
||||
]);
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions): void {
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user