Add login-google, admin/errors routes and Google login methods1

This commit is contained in:
Hamza-Ayed
2026-04-23 23:30:17 +03:00
parent 8c9836a20c
commit 650cce2e86

View File

@@ -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()