From 623f8f3e084627eda56916c08a46ad0a197e1950 Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Wed, 28 Aug 2024 22:12:19 +0000 Subject: [PATCH 1/2] fix: update password reset method name to match js lib --- supabase_auth/_async/gotrue_client.py | 16 +++++++++++----- supabase_auth/_sync/gotrue_client.py | 16 +++++++++++----- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/supabase_auth/_async/gotrue_client.py b/supabase_auth/_async/gotrue_client.py index c3d2b417..5a21306a 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 fd7d3240..cdb8ff33 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: From 920d95caa3327730cc7ce9862b96f66d641d8a5d Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Wed, 28 Aug 2024 22:13:55 +0000 Subject: [PATCH 2/2] fix: update reset password options property name --- supabase_auth/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supabase_auth/types.py b/supabase_auth/types.py index d542c955..742774a4 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):