feat: Turnstile captcha, menu khách + nút tắt topbar cấu hình từ admin, ẩn setting nhạy cảm
- Turnstile (App\Support\Turnstile, middleware turnstile) cho login admin và login/register/forgot/reset của khách; cấu hình ở setting key=turnstile, secret mã hoá SignRSA. - Menu sidebar khách (setting client_menu) và nút tắt topbar (setting client_quick_links) do admin sửa qua administrator/client-menu[/quick-links], khách đọc v1/setting/menu, v1/setting/quick-links. - v1/setting và settings/public chỉ trả whitelist PublicSetting::FIELDS (trước đây lộ bot_token, inet_api_key). - Cài đặt tài khoản khách (preferences), rate limit theo IP cho register/resend-verify. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
823af4a56a
commit
e888a6ed5d
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Controllers\Api\Admin\Setting;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Support\ClientMenu;
|
||||
use App\Support\ClientQuickLinks;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ClientMenuController extends Controller
|
||||
{
|
||||
public function show(): JsonResponse
|
||||
{
|
||||
return response()->json(['error' => false, 'data' => ClientMenu::items()]);
|
||||
}
|
||||
|
||||
public function update(Request $request): JsonResponse
|
||||
{
|
||||
$validated = $request->validate(ClientMenu::rules());
|
||||
|
||||
return response()->json([
|
||||
'error' => false,
|
||||
'message' => 'Đã lưu menu.',
|
||||
'data' => ClientMenu::save($validated['items']),
|
||||
]);
|
||||
}
|
||||
|
||||
public function showQuickLinks(): JsonResponse
|
||||
{
|
||||
return response()->json(['error' => false, 'data' => ClientQuickLinks::items()]);
|
||||
}
|
||||
|
||||
public function updateQuickLinks(Request $request): JsonResponse
|
||||
{
|
||||
$validated = $request->validate(ClientQuickLinks::rules());
|
||||
|
||||
return response()->json([
|
||||
'error' => false,
|
||||
'message' => 'Đã lưu nút tắt.',
|
||||
'data' => ClientQuickLinks::save($validated['items']),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user