Skip to content

Commit d27a37d

Browse files
committed
fix: sendEmail override issue
1 parent 984b424 commit d27a37d

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## unreleased
99

10+
## [0.11.9] - 2022-12-06
11+
12+
- Fixes issue where if send_email is overridden with a different email, it will reset that email.
13+
1014
## [0.11.8] - 2022-11-28
1115

1216
### Added:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
setup(
7272
name="supertokens_python",
73-
version="0.11.8",
73+
version="0.11.9",
7474
author="SuperTokens",
7575
license="Apache 2.0",
7676
author_email="[email protected]",

supertokens_python/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414
SUPPORTED_CDI_VERSIONS = ["2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15"]
15-
VERSION = "0.11.8"
15+
VERSION = "0.11.9"
1616
TELEMETRY = "/telemetry"
1717
USER_COUNT = "/users/count"
1818
USER_DELETE = "/user/remove"

supertokens_python/recipe/emailpassword/emaildelivery/services/backward_compatibility/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@
1717
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Dict, Union
1818

1919
from httpx import AsyncClient
20+
2021
from supertokens_python.ingredients.emaildelivery.types import EmailDeliveryInterface
2122
from supertokens_python.logger import log_debug_message
2223
from supertokens_python.recipe.emailpassword.interfaces import (
2324
EmailTemplateVars,
2425
RecipeInterface,
2526
)
26-
from supertokens_python.recipe.emailpassword.types import (
27-
User,
28-
)
27+
from supertokens_python.recipe.emailpassword.types import User
2928
from supertokens_python.supertokens import AppInfo
3029
from supertokens_python.utils import handle_httpx_client_exceptions
3130

@@ -96,6 +95,10 @@ async def send_email(
9695
if user is None:
9796
raise Exception("Should never come here")
9897

98+
# we add this here cause the user may have overridden the sendEmail function
99+
# to change the input email and if we don't do this, the input email
100+
# will get reset by the getUserById call above.
101+
user.email = template_vars.user.email
99102
try:
100103
await self.reset_password_feature_send_email_func(
101104
user, template_vars.password_reset_link, user_context

0 commit comments

Comments
 (0)