## 인증 모달 통합
- api-explorer, flow-tester, api-logs 3개 페이지의 인증 UI 통합
- 공유 컴포넌트 생성: auth-modal.blade.php, auth-scripts.blade.php
- sessionStorage 기반으로 페이지 간 인증 상태 공유
- DevToolsAuth 글로벌 JavaScript API 제공
## 테넌트 사용자 조회 개선
- 시스템 헤더에서 선택한 테넌트의 사용자 목록 표시
- 관리자가 모든 테넌트의 사용자 조회 가능 (소속 무관)
- session('selected_tenant_id')로 Tenant 모델 직접 조회
- 테넌트 미선택 시 안내 메시지 표시
## 버그 수정
- /users 페이지 HTMX swap 오류 수정 (JSON→HTML 직접 반환)
- 사용자 이름 JavaScript 이스케이프 처리 (@js() 사용)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
90 lines
5.0 KiB
PHP
90 lines
5.0 KiB
PHP
{{--
|
|
Dev Tools 공유 인증 모달
|
|
사용법: @include('dev-tools.partials.auth-modal')
|
|
--}}
|
|
|
|
<!-- 인증 모달 -->
|
|
<div id="devToolsAuthModal" class="fixed inset-0 z-50 hidden">
|
|
<div class="fixed inset-0 bg-black/50" onclick="DevToolsAuth.closeModal()"></div>
|
|
<div class="fixed inset-0 flex items-center justify-center p-4">
|
|
<div class="bg-white rounded-lg shadow-xl max-w-lg w-full p-6 relative">
|
|
<!-- 헤더 -->
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h3 class="text-lg font-semibold text-gray-900">인증 설정</h3>
|
|
<button onclick="DevToolsAuth.closeModal()" class="text-gray-400 hover:text-gray-600">
|
|
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- 인증 방식 선택 -->
|
|
<div class="mb-4">
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">인증 방식</label>
|
|
<div class="flex gap-4">
|
|
<label class="flex items-center">
|
|
<input type="radio" name="devToolsAuthType" value="token" checked onchange="DevToolsAuth.toggleType()" class="mr-2">
|
|
<span class="text-sm">토큰 직접 입력</span>
|
|
</label>
|
|
<label class="flex items-center">
|
|
<input type="radio" name="devToolsAuthType" value="user" onchange="DevToolsAuth.toggleType()" class="mr-2">
|
|
<span class="text-sm">사용자 선택</span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 토큰 직접 입력 섹션 -->
|
|
<div id="devToolsAuthTokenSection" class="mb-4">
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">Bearer 토큰</label>
|
|
<input type="text" id="devToolsAuthBearerToken" placeholder="Bearer 토큰을 입력하세요"
|
|
class="w-full border rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
|
</div>
|
|
|
|
<!-- 사용자 선택 섹션 -->
|
|
<div id="devToolsAuthUserSection" class="mb-4 hidden">
|
|
<!-- 현재 테넌트 표시 -->
|
|
<div id="devToolsAuthTenantLabel" class="hidden mb-2 px-3 py-2 bg-blue-50 border border-blue-200 rounded-lg text-sm text-blue-700">
|
|
테넌트: 로딩 중...
|
|
</div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">사용자 선택</label>
|
|
<select id="devToolsAuthSelectedUser" class="w-full border rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
|
<option value="">사용자를 선택하세요</option>
|
|
</select>
|
|
<div id="devToolsAuthUserSpinner" class="hidden mt-2 text-sm text-gray-500">
|
|
<svg class="animate-spin h-4 w-4 inline mr-1" fill="none" viewBox="0 0 24 24">
|
|
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
|
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path>
|
|
</svg>
|
|
사용자 목록 로딩 중...
|
|
</div>
|
|
<p class="mt-1 text-xs text-gray-500">
|
|
시스템 헤더에서 선택한 테넌트의 사용자 목록입니다.<br>
|
|
선택된 사용자로 Sanctum 토큰이 자동 발급됩니다.
|
|
</p>
|
|
</div>
|
|
|
|
<!-- 현재 인증 상태 -->
|
|
<div id="devToolsAuthCurrentStatus" class="mb-4 p-3 bg-gray-50 rounded-lg">
|
|
<div class="text-sm text-gray-600">
|
|
<span class="font-medium">현재 상태:</span>
|
|
<span id="devToolsAuthStatusDisplay" class="text-gray-500">인증 필요</span>
|
|
</div>
|
|
<div id="devToolsAuthUserInfo" class="mt-1 text-xs text-gray-500 hidden"></div>
|
|
</div>
|
|
|
|
<!-- 버튼 -->
|
|
<div class="flex justify-end gap-3">
|
|
<button type="button" onclick="DevToolsAuth.clear()" class="px-4 py-2 text-red-600 bg-red-50 hover:bg-red-100 rounded-lg transition">
|
|
인증 초기화
|
|
</button>
|
|
<button type="button" onclick="DevToolsAuth.closeModal()" class="px-4 py-2 text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-lg transition">
|
|
닫기
|
|
</button>
|
|
<button type="button" onclick="DevToolsAuth.save()" class="px-4 py-2 text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition">
|
|
적용
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|