store totp_identifier to credentials with fallback for login runs (#4154)

This commit is contained in:
Marc Kelechava
2025-12-01 16:19:37 -08:00
committed by GitHub
parent acce1c869d
commit 7100b7e004
6 changed files with 49 additions and 16 deletions

View File

@@ -34,6 +34,11 @@ class PasswordCredentialResponse(BaseModel):
description="Type of 2FA method used for this credential",
examples=[TotpType.AUTHENTICATOR],
)
totp_identifier: str | None = Field(
default=None,
description="Identifier (email or phone number) used to fetch TOTP codes",
examples=["user@example.com", "+14155550123"],
)
class CreditCardCredentialResponse(BaseModel):
@@ -58,6 +63,11 @@ class PasswordCredential(BaseModel):
description="Type of 2FA method used for this credential",
examples=[TotpType.AUTHENTICATOR],
)
totp_identifier: str | None = Field(
default=None,
description="Identifier (email or phone number) used to fetch TOTP codes",
examples=["user@example.com", "+14155550123"],
)
class NonEmptyPasswordCredential(PasswordCredential):
@@ -155,6 +165,11 @@ class Credential(BaseModel):
description="Type of 2FA method used for this credential",
examples=[TotpType.AUTHENTICATOR],
)
totp_identifier: str | None = Field(
default=None,
description="Identifier (email or phone number) used to fetch TOTP codes",
examples=["user@example.com", "+14155550123"],
)
card_last4: str | None = Field(..., description="For credit_card credentials: the last four digits of the card")
card_brand: str | None = Field(..., description="For credit_card credentials: the card brand")