Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update password reset method name to match js lib #584

Merged
merged 2 commits into from
Aug 29, 2024
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
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
Loading