feat(admin): GitHub OAuth 기반 인페이지 어드민 draft 전환 기능 추가 - #166
Merged
Merged
Conversation
- /admin: GitHub OAuth 로그인 후 글 draft↔발행 토글 (GitHub Contents API 커밋) - 토큰 교환용 Cloudflare Worker 프록시(oauth-proxy/) 추가 - /admin·/admin/callback을 noindex 정적 셸로 프리렌더해 hydration 일치 유지 - 로그인 시 사이드바에 관리자 메뉴 노출, 셋업 가이드(docs/admin.md)·환경변수 키 추가
…-c4e0f4 # Conflicts: # src/routes.server.tsx # src/routes.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
목적
직접 repo를 편집하지 않고도, 관리자가 블로그 페이지 안에서 GitHub 로그인 후 글의 초안(draft) ↔ 발행 상태를 전환할 수 있게 한다.
내용(의도 포함)
/admin: GitHub OAuth 로그인 → 글 목록(초안 포함, GitHub API 직접 조회) → 각 글 draft 토글. 토글 시 frontmatterdraft값을 Contents API로 커밋하며, Actions 재빌드로 사이트에 반영된다.oauth-proxy/)를 분리했다. client_secret은 Worker 시크릿에만 존재한다.ADMIN_LOGIN(devy1540)과 GitHub login 일치 여부로 하고, 실제 권한은 토큰이 강제한다./admin·/admin/callback은 noindex 정적 셸로 프리렌더해 SPA fallback hydration 불일치를 방지한다.VITE_GITHUB_CLIENT_ID·VITE_OAUTH_PROXY_URL이 비어 있으면/admin은 "미설정" 안내만 표시하고 나머지 사이트는 정상 동작한다(현재 값 비어 있음 → 기능 휴면). 셋업 절차는docs/admin.md.성공기준
npm run type-check통과 (에러 0)npm run lint통과 (에러 0, 경고는 기존 패턴과 동일)npm run build성공 —/admin·/admin/callback포함 100페이지 프리렌더 생성npm run preview에서/admin/,/admin/callback/?code=...&state=...,/를 하드 로드 시 콘솔 hydration 경고·React 에러 0건 확인