Add Auth0 login gate for admin actions

Show login status in header, guard manage actions behind allowed emails, and add Auth0 SPA SDK with CDN fallback.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dsyoon
2026-02-07 17:53:59 +09:00
parent 02082eb16d
commit 97c8fe8069
5 changed files with 339 additions and 5 deletions

View File

@@ -16,6 +16,22 @@ python3 -m http.server 8000
그 후 브라우저에서 `http://localhost:8000`으로 접속합니다.
## 로그인(관리 기능 잠금)
이 프로젝트는 **정적 사이트**에서 동작하도록, 관리 기능(추가/편집/삭제/가져오기)을 **로그인 후(허용 이메일)** 에만 활성화할 수 있습니다.
- **지원 방식**: Auth0 SPA SDK + Auth0 Universal Login
- **구글/카카오/네이버**: Auth0 대시보드에서 Social/Custom OAuth 연결로 구성합니다.
설정 방법:
1. Auth0에서 **Single Page Application** 생성
2. `index.html``window.AUTH_CONFIG``domain`, `clientId` 입력
3. Auth0 Application 설정에서 아래 URL들을 등록
- Allowed Callback URLs: 사이트 주소 (예: `https://example.com/`)
- Allowed Logout URLs: 사이트 주소 (예: `https://example.com/`)
4. `allowedEmails`에 관리 허용 이메일 목록을 입력
## 데이터 저장
- 기본 링크: `links.json`