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

This commit is contained in:
Hamza-Ayed
2026-04-23 23:22:29 +03:00
parent 3c0b0a7dcd
commit 8c9836a20c
3 changed files with 157 additions and 0 deletions

View File

@@ -268,4 +268,24 @@ class MiscController extends Controller
]);
}
}
/**
* POST /v2/admin/errors
* Accepts client-side error reports from Flutter apps.
* Public endpoint (no auth required) — just logs the error.
*/
public function logClientError(Request $request): JsonResponse
{
$body = $request->getContent();
\Illuminate\Support\Facades\Log::channel('single')->warning('Client Error Report', [
'ip' => $request->ip(),
'body' => substr($body, 0, 2000), // Limit to 2KB
'user_agent' => $request->userAgent(),
]);
return response()->json([
'status' => 'success',
'message' => 'Error logged',
]);
}
}