Fix OAuth payload validation regressions

This commit is contained in:
Yanli 盐粒
2026-03-18 17:56:38 +08:00
parent 1e5e65326e
commit c71e407c39
2 changed files with 4 additions and 4 deletions

View File

@ -30,8 +30,8 @@ class GitHubEmailRecord(TypedDict, total=False):
class GitHubRawUserInfo(TypedDict):
id: int | str
login: str
name: NotRequired[str]
email: NotRequired[str]
name: NotRequired[str | None]
email: NotRequired[str | None]
class GoogleRawUserInfo(TypedDict):
@ -138,7 +138,7 @@ class GitHubOAuth(OAuth):
email = payload.get("email")
if not email:
email = f"{payload['id']}+{payload['login']}@users.noreply.github.com"
return OAuthUserInfo(id=str(payload["id"]), name=str(payload.get("name", "")), email=email)
return OAuthUserInfo(id=str(payload["id"]), name=payload.get("name") or "", email=email)
class GoogleOAuth(OAuth):

View File

@ -20,7 +20,7 @@ else:
class NotionPageSummary(TypedDict):
page_id: str
page_name: str
page_icon: dict[str, str] | None
page_icon: dict[str, object] | None
parent_id: str
type: Literal["page", "database"]