Skip to content

Commit

Permalink
fixes bug with create_reset_password_link in emailpassword recip
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhpoddar committed Nov 14, 2023
1 parent 4106316 commit 2195b23
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

## [0.17.0] - 2023-11-14
- Fixes `create_reset_password_link` in the emailpassword recipe wherein we passed the `rid` instead of the token in the link

### Breaking fix
- Fixed spelling of `CreateResetPasswordLinkUnknownUserIdError` in `create_reset_password_link`. It used to be `CreateResetPasswordLinkUknownUserIdError`

## [0.16.8] - 2023-11-7

### Added
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

setup(
name="supertokens_python",
version="0.16.8",
version="0.17.0",
author="SuperTokens",
license="Apache 2.0",
author_email="[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion supertokens_python/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from __future__ import annotations

SUPPORTED_CDI_VERSIONS = ["3.0"]
VERSION = "0.16.8"
VERSION = "0.17.0"
TELEMETRY = "/telemetry"
USER_COUNT = "/users/count"
USER_DELETE = "/user/remove"
Expand Down
8 changes: 4 additions & 4 deletions supertokens_python/recipe/emailpassword/asyncio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from supertokens_python.recipe.emailpassword.interfaces import (
CreateResetPasswordWrongUserIdError,
CreateResetPasswordLinkUknownUserIdError,
CreateResetPasswordLinkUnknownUserIdError,
CreateResetPasswordLinkOkResult,
SendResetPasswordEmailOkResult,
SendResetPasswordEmailUnknownUserIdError,
Expand Down Expand Up @@ -139,14 +139,14 @@ async def create_reset_password_link(
):
token = await create_reset_password_token(tenant_id, user_id, user_context)
if isinstance(token, CreateResetPasswordWrongUserIdError):
return CreateResetPasswordLinkUknownUserIdError()
return CreateResetPasswordLinkUnknownUserIdError()

recipe_instance = EmailPasswordRecipe.get_instance()
return CreateResetPasswordLinkOkResult(
link=get_password_reset_link(
recipe_instance.get_app_info(),
recipe_instance.get_recipe_id(),
token.token,
recipe_instance.get_recipe_id(),
tenant_id,
)
)
Expand All @@ -156,7 +156,7 @@ async def send_reset_password_email(
tenant_id: str, user_id: str, user_context: Optional[Dict[str, Any]] = None
):
link = await create_reset_password_link(tenant_id, user_id, user_context)
if isinstance(link, CreateResetPasswordLinkUknownUserIdError):
if isinstance(link, CreateResetPasswordLinkUnknownUserIdError):
return SendResetPasswordEmailUnknownUserIdError()

user = await get_user_by_id(user_id, user_context)
Expand Down
2 changes: 1 addition & 1 deletion supertokens_python/recipe/emailpassword/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init__(self, link: str):
self.link = link


class CreateResetPasswordLinkUknownUserIdError:
class CreateResetPasswordLinkUnknownUserIdError:
pass


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

from supertokens_python.recipe.thirdpartyemailpassword.interfaces import (
CreateResetPasswordWrongUserIdError,
CreateResetPasswordLinkUknownUserIdError,
CreateResetPasswordLinkUnknownUserIdError,
CreateResetPasswordLinkOkResult,
SendResetPasswordEmailUnknownUserIdError,
SendResetPasswordEmailEmailOkResult,
Expand Down Expand Up @@ -189,7 +189,7 @@ async def create_reset_password_link(
):
token = await create_reset_password_token(tenant_id, user_id, user_context)
if isinstance(token, CreateResetPasswordWrongUserIdError):
return CreateResetPasswordLinkUknownUserIdError()
return CreateResetPasswordLinkUnknownUserIdError()

recipe_instance = ThirdPartyEmailPasswordRecipe.get_instance()

Expand All @@ -212,7 +212,7 @@ async def send_reset_password_email(
user_context: Optional[Dict[str, Any]] = None,
):
link = await create_reset_password_link(tenant_id, user_id, user_context)
if isinstance(link, CreateResetPasswordLinkUknownUserIdError):
if isinstance(link, CreateResetPasswordLinkUnknownUserIdError):
return SendResetPasswordEmailUnknownUserIdError()

user = await get_user_by_id(user_id, user_context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
CreateResetPasswordOkResult = EPInterfaces.CreateResetPasswordOkResult
CreateResetPasswordWrongUserIdError = EPInterfaces.CreateResetPasswordWrongUserIdError
CreateResetPasswordLinkOkResult = EPInterfaces.CreateResetPasswordLinkOkResult
CreateResetPasswordLinkUknownUserIdError = (
EPInterfaces.CreateResetPasswordLinkUknownUserIdError
CreateResetPasswordLinkUnknownUserIdError = (
EPInterfaces.CreateResetPasswordLinkUnknownUserIdError
)
SendResetPasswordEmailEmailOkResult = EPInterfaces.SendResetPasswordEmailOkResult
SendResetPasswordEmailUnknownUserIdError = (
Expand Down

0 comments on commit 2195b23

Please sign in to comment.