Skip to content

Commit

Permalink
fix: update password reset method name to match js lib (#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
silentworks authored Aug 29, 2024
1 parent 14f4444 commit d47daf1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
16 changes: 11 additions & 5 deletions supabase_auth/_async/gotrue_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,11 +711,7 @@ def _unsubscribe() -> None:
self._state_change_emitters[unique_id] = subscription
return subscription

async def reset_password_email(
self,
email: str,
options: Options = {},
) -> None:
async def reset_password_for_email(self, email: str, options: Options = {}) -> None:
"""
Sends a password reset request to an email address.
"""
Expand All @@ -731,6 +727,16 @@ async def reset_password_email(
redirect_to=options.get("redirect_to"),
)

async def reset_password_email(
self,
email: str,
options: Options = {},
) -> None:
"""
Sends a password reset request to an email address.
"""
await self.reset_password_for_email(email, options)

# MFA methods

async def _enroll(self, params: MFAEnrollParams) -> AuthMFAEnrollResponse:
Expand Down
16 changes: 11 additions & 5 deletions supabase_auth/_sync/gotrue_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,11 +703,7 @@ def _unsubscribe() -> None:
self._state_change_emitters[unique_id] = subscription
return subscription

def reset_password_email(
self,
email: str,
options: Options = {},
) -> None:
def reset_password_for_email(self, email: str, options: Options = {}) -> None:
"""
Sends a password reset request to an email address.
"""
Expand All @@ -723,6 +719,16 @@ def reset_password_email(
redirect_to=options.get("redirect_to"),
)

def reset_password_email(
self,
email: str,
options: Options = {},
) -> None:
"""
Sends a password reset request to an email address.
"""
self.reset_password_for_email(email, options)

# MFA methods

def _enroll(self, params: MFAEnrollParams) -> AuthMFAEnrollResponse:
Expand Down
2 changes: 1 addition & 1 deletion supabase_auth/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class AMREntry(BaseModel):

class Options(TypedDict):
redirect_to: NotRequired[str]
data: NotRequired[Any]
captcha_token: NotRequired[str]


class AuthResponse(BaseModel):
Expand Down

0 comments on commit d47daf1

Please sign in to comment.