Skip to content

Commit 1183ef4

Browse files
authored
Merge branch 'feat/tp-rework' into fix/compulsory-tenant-id
2 parents c328686 + 86b02a9 commit 1183ef4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+312
-362
lines changed

supertokens_python/recipe/emailpassword/api/implementation.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ async def sign_in_post(
170170
user = result.user
171171
session = await create_new_session(
172172
api_options.request,
173-
"pass-tenant-id", # TODO: change this to tenant_id
174173
user.user_id,
175174
access_token_payload={},
176175
session_data_in_database={},
@@ -210,7 +209,6 @@ async def sign_up_post(
210209
user = result.user
211210
session = await create_new_session(
212211
api_options.request,
213-
"pass-tenant-id", # TODO: change this to tenant_id
214212
user.user_id,
215213
access_token_payload={},
216214
session_data_in_database={},

supertokens_python/recipe/multitenancy/asyncio/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
CreateOrUpdateThirdPartyConfigOkResult,
2424
DeleteThirdPartyConfigOkResult,
2525
AssociateUserToTenantOkResult,
26-
AssociateUserToTenantUnknownUserIdErrorResult,
27-
AssociateUserToTenantEmailAlreadyExistsErrorResult,
28-
AssociateUserToTenantPhoneNumberAlreadyExistsErrorResult,
29-
AssociateUserToTenantThirdPartyUserAlreadyExistsErrorResult,
26+
AssociateUserToTenantUnknownUserIdError,
27+
AssociateUserToTenantEmailAlreadyExistsError,
28+
AssociateUserToTenantPhoneNumberAlreadyExistsError,
29+
AssociateUserToTenantThirdPartyUserAlreadyExistsError,
3030
DisassociateUserFromTenantOkResult,
3131
)
3232
from ..recipe import MultitenancyRecipe
@@ -117,10 +117,10 @@ async def associate_user_to_tenant(
117117
user_context: Optional[Dict[str, Any]] = None,
118118
) -> Union[
119119
AssociateUserToTenantOkResult,
120-
AssociateUserToTenantUnknownUserIdErrorResult,
121-
AssociateUserToTenantEmailAlreadyExistsErrorResult,
122-
AssociateUserToTenantPhoneNumberAlreadyExistsErrorResult,
123-
AssociateUserToTenantThirdPartyUserAlreadyExistsErrorResult,
120+
AssociateUserToTenantUnknownUserIdError,
121+
AssociateUserToTenantEmailAlreadyExistsError,
122+
AssociateUserToTenantPhoneNumberAlreadyExistsError,
123+
AssociateUserToTenantThirdPartyUserAlreadyExistsError,
124124
]:
125125
if user_context is None:
126126
user_context = {}

supertokens_python/recipe/multitenancy/interfaces.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,19 @@ def __init__(self, was_already_associated: bool):
129129
self.was_already_associated = was_already_associated
130130

131131

132-
class AssociateUserToTenantUnknownUserIdErrorResult:
132+
class AssociateUserToTenantUnknownUserIdError:
133133
status = "UNKNOWN_USER_ID_ERROR"
134134

135135

136-
class AssociateUserToTenantEmailAlreadyExistsErrorResult:
136+
class AssociateUserToTenantEmailAlreadyExistsError:
137137
status = "EMAIL_ALREADY_EXISTS_ERROR"
138138

139139

140-
class AssociateUserToTenantPhoneNumberAlreadyExistsErrorResult:
140+
class AssociateUserToTenantPhoneNumberAlreadyExistsError:
141141
status = "PHONE_NUMBER_ALREADY_EXISTS_ERROR"
142142

143143

144-
class AssociateUserToTenantThirdPartyUserAlreadyExistsErrorResult:
144+
class AssociateUserToTenantThirdPartyUserAlreadyExistsError:
145145
status = "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR"
146146

147147

@@ -218,10 +218,10 @@ async def associate_user_to_tenant(
218218
user_context: Dict[str, Any],
219219
) -> Union[
220220
AssociateUserToTenantOkResult,
221-
AssociateUserToTenantUnknownUserIdErrorResult,
222-
AssociateUserToTenantEmailAlreadyExistsErrorResult,
223-
AssociateUserToTenantPhoneNumberAlreadyExistsErrorResult,
224-
AssociateUserToTenantThirdPartyUserAlreadyExistsErrorResult,
221+
AssociateUserToTenantUnknownUserIdError,
222+
AssociateUserToTenantEmailAlreadyExistsError,
223+
AssociateUserToTenantPhoneNumberAlreadyExistsError,
224+
AssociateUserToTenantThirdPartyUserAlreadyExistsError,
225225
]:
226226
pass
227227

@@ -336,6 +336,5 @@ async def login_methods_get(
336336

337337

338338
TypeGetAllowedDomainsForTenantId = Callable[
339-
[str, Dict[str, Any]],
340-
Awaitable[List[str]],
339+
[str, Dict[str, Any]], Awaitable[Optional[List[str]]]
341340
]

supertokens_python/recipe/multitenancy/recipe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ async def login_methods_get(
262262

263263
class AllowedDomainsClaimClass(PrimitiveArrayClaim[List[str]]):
264264
def __init__(self):
265-
default_max_age_in_sec = 60 * 60 * 24 * 7
265+
default_max_age_in_sec = 60 * 60
266266

267267
async def fetch_value(
268268
_: str, tenant_id: str, user_context: Dict[str, Any]

0 commit comments

Comments
 (0)