Skip to content

Commit a53aeb0

Browse files
committed
fix: Suggested changes to make pass None for tenant_id as default
1 parent 96234e1 commit a53aeb0

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

supertokens_python/recipe/session/asyncio/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ async def create_new_session_without_request_response(
107107
final_access_token_payload = {**access_token_payload, "iss": issuer}
108108

109109
for claim in claims_added_by_other_recipes:
110-
update = await claim.build(user_id, "pass-tenant-id", user_context)
110+
update = await claim.build(user_id, tenant_id, user_context)
111111
final_access_token_payload = {**final_access_token_payload, **update}
112112

113113
return await SessionRecipe.get_instance().recipe_implementation.create_new_session(
@@ -426,7 +426,7 @@ async def revoke_session(
426426

427427

428428
async def revoke_all_sessions_for_user(
429-
user_id: str, tenant_id: Optional[str], user_context: Union[None, Dict[str, Any]] = None
429+
user_id: str, tenant_id: Optional[str] = None, user_context: Union[None, Dict[str, Any]] = None
430430
) -> List[str]:
431431
if user_context is None:
432432
user_context = {}

supertokens_python/recipe/session/session_class.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
14-
from typing import Any, Dict, List, Optional, TypeVar, Union
14+
from typing import Any, Dict, List, TypeVar, Union
1515

1616
from supertokens_python.recipe.session.exceptions import (
1717
raise_invalid_claims_exception,

supertokens_python/recipe/session/session_request_functions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,7 @@ async def create_new_session_in_request(
239239
final_access_token_payload = {**access_token_payload, "iss": issuer}
240240

241241
for claim in claims_added_by_other_recipes:
242-
# TODO: Pass tenant id
243-
update = await claim.build(user_id, "pass-tenant-id", user_context)
242+
update = await claim.build(user_id, tenant_id, user_context)
244243
final_access_token_payload = {**final_access_token_payload, **update}
245244

246245
log_debug_message("createNewSession: Access token payload built")

supertokens_python/recipe/session/syncio/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def revoke_session(
187187

188188

189189
def revoke_all_sessions_for_user(
190-
user_id: str, tenant_id: Optional[str], user_context: Union[None, Dict[str, Any]] = None
190+
user_id: str, tenant_id: Optional[str] = None, user_context: Union[None, Dict[str, Any]] = None
191191
) -> List[str]:
192192
from supertokens_python.recipe.session.asyncio import (
193193
revoke_all_sessions_for_user as async_revoke_all_sessions_for_user,
@@ -197,7 +197,7 @@ def revoke_all_sessions_for_user(
197197

198198

199199
def get_all_session_handles_for_user(
200-
user_id: str, tenant_id: Optional[str], user_context: Union[None, Dict[str, Any]] = None
200+
user_id: str, tenant_id: Optional[str] = None, user_context: Union[None, Dict[str, Any]] = None
201201
) -> List[str]:
202202
from supertokens_python.recipe.session.asyncio import (
203203
get_all_session_handles_for_user as async_get_all_session_handles_for_user,

0 commit comments

Comments
 (0)