add d1kt SSO integration: OAuth2 login via WebView + phone binding

This commit is contained in:
2026-08-31 16:50:49 +08:00
parent 3652ebda07
commit daa73e2b98
6 changed files with 454 additions and 0 deletions

View File

@@ -155,6 +155,21 @@ class AuthResponse(BaseModel):
user: UserPublic
class SsoExchangeRequest(BaseModel):
access_token: str = Field(min_length=1, max_length=256)
class SsoExchangeResponse(BaseModel):
token: str
user: UserPublic
phone_bound: bool = False
is_new_user: bool = False
class SsoBindPhoneRequest(BaseModel):
phone: str = Field(min_length=1, max_length=20, pattern=r"^1[3-9]\d{9}$")
class UserAdminItem(BaseModel):
id: str
username: str