Files
sidata/app/Http/Middleware/Authenticate.php
T
gitea 674941939c
CI/CD Pipeline to Rancher - SIDATA / build-and-deploy (push) Failing after 2m3s
fix: support sidataprod path behind traefik
2026-09-06 12:02:09 +07:00

22 lines
576 B
PHP

<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string|null
*/
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
// Paksa redirect membawa prefix /sidata agar tidak terlempar ke root domain
return redirect()->guest(route('login'));
}
}
}