mirror of
https://github.com/dyzulk/trustlab-api.git
synced 2026-01-26 05:15:35 +07:00
128 lines
5.4 KiB
Plaintext
128 lines
5.4 KiB
Plaintext
commit 73bd94c021cfd0d637f043511601d48c97acc119
|
|
Author: dyzulk <66510723+dyzulk@users.noreply.github.com>
|
|
Date: Fri Jan 9 13:36:04 2026 +0700
|
|
|
|
chore: remove temporary debug routes and methods
|
|
|
|
diff --git a/app/Http/Controllers/Api/RootCaApiController.php b/app/Http/Controllers/Api/RootCaApiController.php
|
|
index bcad324..010cdc8 100644
|
|
--- a/app/Http/Controllers/Api/RootCaApiController.php
|
|
+++ b/app/Http/Controllers/Api/RootCaApiController.php
|
|
@@ -149,41 +149,6 @@ public function syncToCdn(Request $request)
|
|
}
|
|
}
|
|
|
|
- public function debugInstaller()
|
|
- {
|
|
- // Permission check skipped for debugging (Public Route)
|
|
- // $this->authorizeAdminOrOwner();
|
|
-
|
|
- try {
|
|
- $cert = \App\Models\CaCertificate::latest()->first();
|
|
- if (!$cert) return response()->json(['message' => 'No certs found']);
|
|
-
|
|
- $installerService = app(\App\Services\CaInstallerService::class);
|
|
-
|
|
- // Test Windows Generation
|
|
- $winContent = $installerService->generateWindowsInstaller($cert);
|
|
-
|
|
- // Test Linux Generation
|
|
- $linuxContent = $installerService->generateLinuxInstaller($cert);
|
|
-
|
|
- return response()->json([
|
|
- 'status' => 'success',
|
|
- 'message' => 'Installer generation test passed',
|
|
- 'data' => [
|
|
- 'windows_length' => strlen($winContent),
|
|
- 'linux_length' => strlen($linuxContent)
|
|
- ]
|
|
- ]);
|
|
- } catch (\Throwable $e) {
|
|
- return response()->json([
|
|
- 'status' => 'error',
|
|
- 'message' => $e->getMessage(),
|
|
- 'file' => $e->getFile(),
|
|
- 'line' => $e->getLine(),
|
|
- 'trace' => $e->getTraceAsString()
|
|
- ], 500);
|
|
- }
|
|
- }
|
|
|
|
public function promote(CaCertificate $certificate)
|
|
{
|
|
diff --git a/app/Http/Controllers/NavigationController.php b/app/Http/Controllers/NavigationController.php
|
|
index 8ce5073..262ffcb 100644
|
|
--- a/app/Http/Controllers/NavigationController.php
|
|
+++ b/app/Http/Controllers/NavigationController.php
|
|
@@ -111,51 +111,4 @@ public function index(Request $request)
|
|
return response()->json($menuGroups);
|
|
}
|
|
|
|
- public function debug()
|
|
- {
|
|
- // Simulate a User instance for admin view
|
|
- $user = new \App\Models\User(['first_name' => 'Debug', 'last_name' => 'Admin', 'role' => 'admin']);
|
|
-
|
|
- // This is a bit of a hack since $user->isAdmin() might be a real method,
|
|
- // but for JSON structure debugging, we'll just replicate the logic or mock it.
|
|
-
|
|
- $menuGroups = [];
|
|
-
|
|
- // 1. Admin Management (Simulated Admin)
|
|
- $menuGroups[] = [
|
|
- 'title' => 'Admin Management',
|
|
- 'items' => [
|
|
- ['name' => 'User Management', 'icon' => 'users', 'route' => '/admin/users'],
|
|
- ['name' => 'Root CA Management', 'icon' => 'certificate', 'route' => '/admin/root-ca'],
|
|
- ['name' => 'Ticket Management', 'icon' => 'support-ticket', 'route' => '/admin/tickets'],
|
|
- ['name' => 'Legal Page Management', 'icon' => 'pages', 'route' => '/dashboard/admin/legal'],
|
|
- ['name' => 'Inquiries', 'icon' => 'inbox', 'route' => '/dashboard/admin/inquiries'],
|
|
- ['name' => 'SMTP Tester', 'icon' => 'smtp', 'route' => '/dashboard/admin/smtp-tester'],
|
|
- ]
|
|
- ];
|
|
-
|
|
- // 2. Main Menu
|
|
- $mainItems = [
|
|
- ['name' => 'Dashboard', 'icon' => 'dashboard', 'route' => '/dashboard'],
|
|
- ['name' => 'Certificates', 'icon' => 'certificate', 'route' => '/dashboard/certificates'],
|
|
- ['name' => 'API Keys', 'icon' => 'api-key', 'route' => '/dashboard/api-keys'],
|
|
- ['name' => 'Support Tickets', 'icon' => 'support-ticket', 'route' => '/dashboard/support'],
|
|
- ];
|
|
-
|
|
- $menuGroups[] = [
|
|
- 'title' => 'Menu',
|
|
- 'items' => $mainItems,
|
|
- ];
|
|
-
|
|
- // 3. My Account
|
|
- $menuGroups[] = [
|
|
- 'title' => 'My Account',
|
|
- 'items' => [
|
|
- ['name' => 'User Profile', 'icon' => 'user-profile', 'route' => '/dashboard/profile'],
|
|
- ['name' => 'Account Settings', 'icon' => 'settings', 'route' => '/dashboard/settings'],
|
|
- ]
|
|
- ];
|
|
-
|
|
- return response()->json($menuGroups);
|
|
- }
|
|
}
|
|
diff --git a/routes/api.php b/routes/api.php
|
|
index 6d45742..d7ebefa 100644
|
|
--- a/routes/api.php
|
|
+++ b/routes/api.php
|
|
@@ -29,14 +29,8 @@
|
|
Route::post('/public/inquiries', [\App\Http\Controllers\Api\InquiryController::class, 'store']);
|
|
Route::get('/public/legal-pages', [\App\Http\Controllers\Api\LegalPageController::class, 'index']);
|
|
Route::get('/public/legal-pages/{slug}', [\App\Http\Controllers\Api\LegalPageController::class, 'show']);
|
|
-// DEBUG ROUTE (Temporary)
|
|
-Route::get('/admin/debug/installer', [RootCaApiController::class, 'debugInstaller']);
|
|
-
|
|
-// Auth routes moved to web.php for SPA session support
|
|
-
|
|
// Auth routes moved to web.php for SPA session support (manually prefixed with /api there)
|
|
// This ensures they use the 'web' middleware stack for proper session persistence.
|
|
-Route::get('/navigation-debug', [NavigationController::class, 'debug']);
|
|
|
|
Route::middleware(['auth:sanctum'])->group(function () {
|
|
Route::delete('/auth/social/{provider}', [AuthController::class, 'disconnectSocial']);
|