From d47daf1a0208c2df1a8993d37991f283f81f3221 Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Thu, 29 Aug 2024 22:33:27 +0000 Subject: [PATCH] fix: update password reset method name to match js lib (#584) --- supabase_auth/_async/gotrue_client.py | 16 +++++++++++----- supabase_auth/_sync/gotrue_client.py | 16 +++++++++++----- supabase_auth/types.py | 2 +- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/supabase_auth/_async/gotrue_client.py b/supabase_auth/_async/gotrue_client.py index 63d344dd..739abaa5 100644 --- a/supabase_auth/_async/gotrue_client.py +++ b/supabase_auth/_async/gotrue_client.py @@ -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. """ @@ -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: diff --git a/supabase_auth/_sync/gotrue_client.py b/supabase_auth/_sync/gotrue_client.py index e4aa1203..dc52c85d 100644 --- a/supabase_auth/_sync/gotrue_client.py +++ b/supabase_auth/_sync/gotrue_client.py @@ -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. """ @@ -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: diff --git a/supabase_auth/types.py b/supabase_auth/types.py index cceb2682..5db169b0 100644 --- a/supabase_auth/types.py +++ b/supabase_auth/types.py @@ -84,7 +84,7 @@ class AMREntry(BaseModel): class Options(TypedDict): redirect_to: NotRequired[str] - data: NotRequired[Any] + captcha_token: NotRequired[str] class AuthResponse(BaseModel):