Skip to content

Commit

Permalink
add channel to sign_in and sign_up options
Browse files Browse the repository at this point in the history
  • Loading branch information
silentworks committed Jun 20, 2024
1 parent e4fc889 commit 5a1c44a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions supabase_auth/_async/gotrue_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ async def sign_up(
options = credentials.get("options", {})
redirect_to = options.get("redirect_to")
data = options.get("data") or {}
channel = options.get("channel", "sms")
captcha_token = options.get("captcha_token")
if email:
response = await self._request(
Expand All @@ -217,6 +218,7 @@ async def sign_up(
"phone": phone,
"password": password,
"data": data,
"channel": channel,
"gotrue_meta_security": {
"captcha_token": captcha_token,
},
Expand Down Expand Up @@ -419,6 +421,7 @@ async def sign_in_with_otp(
email_redirect_to = options.get("email_redirect_to")
should_create_user = options.get("create_user", True)
data = options.get("data")
channel = options.get("channel", "sms")
captcha_token = options.get("captcha_token")
if email:
return await self._request(
Expand All @@ -443,6 +446,7 @@ async def sign_in_with_otp(
"phone": phone,
"data": data,
"create_user": should_create_user,
"channel": channel,
"gotrue_meta_security": {
"captcha_token": captcha_token,
},
Expand Down
2 changes: 2 additions & 0 deletions supabase_auth/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ class SignUpWithEmailAndPasswordCredentials(TypedDict):
class SignUpWithPhoneAndPasswordCredentialsOptions(TypedDict):
data: NotRequired[Any]
captcha_token: NotRequired[str]
channel: NotRequired[Literal["sms", "whatsapp"]]


class SignUpWithPhoneAndPasswordCredentials(TypedDict):
Expand Down Expand Up @@ -313,6 +314,7 @@ class SignInWithPhoneAndPasswordlessCredentialsOptions(TypedDict):
should_create_user: NotRequired[bool]
data: NotRequired[Any]
captcha_token: NotRequired[str]
channel: NotRequired[Literal["sms", "whatsapp"]]


class SignInWithPhoneAndPasswordlessCredentials(TypedDict):
Expand Down

0 comments on commit 5a1c44a

Please sign in to comment.