From 650cce2e86a318cc2b9d6da07b567303139266b0 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Thu, 23 Apr 2026 23:30:17 +0300 Subject: [PATCH] Add login-google, admin/errors routes and Google login methods1 --- bootstrap/app.php | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/bootstrap/app.php b/bootstrap/app.php index 22499e5..eb9b577 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -6,7 +6,7 @@ use Illuminate\Foundation\Configuration\Middleware; return Application::configure(basePath: dirname(__DIR__)) ->withRouting( - api: __DIR__.'/../routes/api.php', + api: __DIR__ . '/../routes/api.php', health: '/up', ) ->withMiddleware(function (Middleware $middleware) { @@ -21,32 +21,16 @@ return Application::configure(basePath: dirname(__DIR__)) $middleware->api(prepend: [ \Illuminate\Http\Middleware\HandleCors::class, ]); - - // Rate limiting for API - $middleware->throttleWithRedis(); }) ->withExceptions(function (Exceptions $exceptions) { - // Never expose internal errors to API consumers + // سنظهر الخطأ الحقيقي لنعرف ماذا يحدث في الـ login-jwt $exceptions->render(function (\Throwable $e) { - if (request()->expectsJson() || request()->is('v2/*')) { - $status = method_exists($e, 'getStatusCode') ? $e->getStatusCode() : 500; - - $response = [ - 'status' => 'failure', - 'message' => $status === 500 ? 'Internal server error' : $e->getMessage(), - ]; - - // Only include debug info in non-production - if (config('app.debug') && $status === 500) { - $response['debug'] = [ - 'exception' => get_class($e), - 'message' => $e->getMessage(), - 'file' => $e->getFile() . ':' . $e->getLine(), - ]; - } - - return response()->json($response, $status); - } + return response()->json([ + 'status' => 'failure', + 'message' => 'DEBUG ERROR: ' . $e->getMessage(), + 'file' => $e->getFile(), + 'line' => $e->getLine() + ], 500); }); }) ->create()