Refactor auth and unify error handling in routers
Renamed AuthRequired/AdminRequired to auth_required/admin_required and updated all references. Replaced direct HTTPException usage with utils.http_exceptions for consistent error handling. Updated router endpoints to use new auth dependency and standardized not implemented responses. Cleaned up unused theme fields in SiteConfigResponse and improved site config endpoint. Minor type and import cleanups across routers and middleware.
This commit is contained in:
@@ -20,11 +20,11 @@ class SiteConfigResponse(SQLModelBase):
|
||||
title: str = "DiskNext"
|
||||
"""网站标题"""
|
||||
|
||||
themes: dict[str, str] = {}
|
||||
"""网站主题配置"""
|
||||
# themes: dict[str, str] = {}
|
||||
# """网站主题配置"""
|
||||
|
||||
default_theme: dict[str, str] = {}
|
||||
"""默认主题RGB色号"""
|
||||
# default_theme: dict[str, str] = {}
|
||||
# """默认主题RGB色号"""
|
||||
|
||||
site_notice: str | None = None
|
||||
"""网站公告"""
|
||||
|
||||
Reference in New Issue
Block a user