Backend enhancements: auth, channels, restaurants, daemon improvements
- Add admin auth dependency and role checks - Expand channel and restaurant API routes - Improve YouTube transcript fetching - Enhance daemon worker with better error handling and scheduling Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,3 +30,11 @@ def get_optional_user(authorization: str = Header(None)) -> dict | None:
|
||||
return verify_jwt(token)
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
|
||||
def get_admin_user(authorization: str = Header(None)) -> dict:
|
||||
"""Require authenticated admin user. Raises 401/403."""
|
||||
user = get_current_user(authorization)
|
||||
if not user.get("is_admin"):
|
||||
raise HTTPException(403, "관리자 권한이 필요합니다")
|
||||
return user
|
||||
|
||||
Reference in New Issue
Block a user