Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions supabase_auth/_async/gotrue_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,14 +805,14 @@ async def _enroll(self, params: MFAEnrollParams) -> AuthMFAEnrollResponse:
raise AuthSessionMissingError()

body = {
"friendly_name": params["friendly_name"],
"factor_type": params["factor_type"],
"friendly_name": params.get("friendly_name"),
"factor_type": params.get("factor_type"),
}

if params["factor_type"] == "phone":
body["phone"] = params["phone"]
body["phone"] = params.get("phone")
else:
body["issuer"] = params["issuer"]
body["issuer"] = params.get("issuer")

response = await self._request(
"POST",
Expand Down
8 changes: 4 additions & 4 deletions supabase_auth/_sync/gotrue_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,14 +801,14 @@ def _enroll(self, params: MFAEnrollParams) -> AuthMFAEnrollResponse:
raise AuthSessionMissingError()

body = {
"friendly_name": params["friendly_name"],
"factor_type": params["factor_type"],
"friendly_name": params.get("friendly_name"),
"factor_type": params.get("factor_type"),
}

if params["factor_type"] == "phone":
body["phone"] = params["phone"]
body["phone"] = params.get("phone")
else:
body["issuer"] = params["issuer"]
body["issuer"] = params.get("issuer")

response = self._request(
"POST",
Expand Down
8 changes: 5 additions & 3 deletions supabase_auth/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from time import time
from typing import Any, Callable, Dict, List, Optional, Union

from pydantic import BaseModel, ConfigDict
from pydantic import BaseModel, ConfigDict, Field

try:
# > 2
Expand Down Expand Up @@ -643,7 +643,7 @@ class AuthMFAEnrollResponse(BaseModel):
"""
Type of MFA factor. Only `totp` supported for now.
"""
totp: AuthMFAEnrollResponseTotp
totp: Optional[AuthMFAEnrollResponseTotp] = None
"""
TOTP enrollment information.
"""
Expand Down Expand Up @@ -680,7 +680,9 @@ class AuthMFAChallengeResponse(BaseModel):
"""
Timestamp in UNIX seconds when this challenge will no longer be usable.
"""
factor_type: Optional[Literal["totp", "phone"]] = None
factor_type: Optional[Literal["totp", "phone"]] = Field(
validation_alias="type", default=None
)
"""
Factor Type which generated the challenge
"""
Expand Down