Skip to content

Commit 6ab731d

Browse files
committed
change config parameter name
1 parent cbfeeea commit 6ab731d

File tree

1 file changed

+32
-18
lines changed

1 file changed

+32
-18
lines changed

supertokens_python/supertokens.py

+32-18
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,19 @@ def __init__(
106106
api_domain: str,
107107
api_gateway_path: str = "",
108108
api_base_path: str = "/auth",
109-
website_base_path: str = "/auth",
110-
website_domain: Optional[str] = None,
109+
client_base_path: str = "/auth",
110+
client_domain: Optional[str] = None,
111111
origin: Optional[
112112
Union[str, Callable[[Optional[BaseRequest], Dict[str, Any]], str]]
113113
] = None,
114114
):
115115
self.app_name = app_name
116116
self.api_gateway_path = api_gateway_path
117117
self.api_domain = api_domain
118-
self.website_domain = website_domain
118+
self.client_domain = client_domain
119119
self.origin = origin
120120
self.api_base_path = api_base_path
121-
self.website_base_path = website_base_path
121+
self.client_base_path = client_base_path
122122

123123

124124
class AppInfo:
@@ -238,9 +238,11 @@ def __init__(
238238
hosts = list(
239239
map(
240240
lambda h: Host(
241-
NormalisedURLDomain(h.strip()), NormalisedURLPath(h.strip())
241+
NormalisedURLDomain(
242+
h.strip()), NormalisedURLPath(h.strip())
242243
),
243-
filter(lambda x: x != "", supertokens_config.connection_uri.split(";")),
244+
filter(lambda x: x != "",
245+
supertokens_config.connection_uri.split(";")),
244246
)
245247
)
246248
Querier.init(
@@ -289,7 +291,8 @@ def make_recipe(recipe: Callable[[AppInfo], RecipeModule]) -> RecipeModule:
289291
jwt_found = True
290292
return recipe_module
291293

292-
self.recipe_modules: List[RecipeModule] = list(map(make_recipe, recipe_list))
294+
self.recipe_modules: List[RecipeModule] = list(
295+
map(make_recipe, recipe_list))
293296

294297
if not jwt_found:
295298
from supertokens_python.recipe.jwt.recipe import JWTRecipe
@@ -304,22 +307,26 @@ def make_recipe(recipe: Callable[[AppInfo], RecipeModule]) -> RecipeModule:
304307
if not multitenancy_found:
305308
from supertokens_python.recipe.multitenancy.recipe import MultitenancyRecipe
306309

307-
self.recipe_modules.append(MultitenancyRecipe.init()(self.app_info))
310+
self.recipe_modules.append(
311+
MultitenancyRecipe.init()(self.app_info))
308312

309313
if totp_found and not multi_factor_auth_found:
310-
raise Exception("Please initialize the MultiFactorAuth recipe to use TOTP.")
314+
raise Exception(
315+
"Please initialize the MultiFactorAuth recipe to use TOTP.")
311316

312317
if not user_metadata_found:
313318
from supertokens_python.recipe.usermetadata.recipe import UserMetadataRecipe
314319

315-
self.recipe_modules.append(UserMetadataRecipe.init()(self.app_info))
320+
self.recipe_modules.append(
321+
UserMetadataRecipe.init()(self.app_info))
316322

317323
if not oauth2_found:
318324
from supertokens_python.recipe.oauth2provider.recipe import (
319325
OAuth2ProviderRecipe,
320326
)
321327

322-
self.recipe_modules.append(OAuth2ProviderRecipe.init()(self.app_info))
328+
self.recipe_modules.append(
329+
OAuth2ProviderRecipe.init()(self.app_info))
323330

324331
self.telemetry = (
325332
telemetry
@@ -354,7 +361,8 @@ def reset():
354361
if ("SUPERTOKENS_ENV" not in environ) or (
355362
environ["SUPERTOKENS_ENV"] != "testing"
356363
):
357-
raise_general_exception("calling testing function in non testing env")
364+
raise_general_exception(
365+
"calling testing function in non testing env")
358366
from supertokens_python.recipe.usermetadata.recipe import UserMetadataRecipe
359367

360368
UserMetadataRecipe.reset()
@@ -442,7 +450,8 @@ async def create_user_id_mapping(
442450

443451
raise_general_exception("Unknown response")
444452

445-
raise_general_exception("Please upgrade the SuperTokens core to >= 3.15.0")
453+
raise_general_exception(
454+
"Please upgrade the SuperTokens core to >= 3.15.0")
446455

447456
async def get_user_id_mapping(
448457
self,
@@ -476,7 +485,8 @@ async def get_user_id_mapping(
476485

477486
raise_general_exception("Unknown response")
478487

479-
raise_general_exception("Please upgrade the SuperTokens core to >= 3.15.0")
488+
raise_general_exception(
489+
"Please upgrade the SuperTokens core to >= 3.15.0")
480490

481491
async def delete_user_id_mapping(
482492
self,
@@ -508,7 +518,8 @@ async def delete_user_id_mapping(
508518

509519
raise_general_exception("Unknown response")
510520

511-
raise_general_exception("Please upgrade the SuperTokens core to >= 3.15.0")
521+
raise_general_exception(
522+
"Please upgrade the SuperTokens core to >= 3.15.0")
512523

513524
async def update_or_delete_user_id_mapping_info(
514525
self,
@@ -538,7 +549,8 @@ async def update_or_delete_user_id_mapping_info(
538549

539550
raise_general_exception("Unknown response")
540551

541-
raise_general_exception("Please upgrade the SuperTokens core to >= 3.15.0")
552+
raise_general_exception(
553+
"Please upgrade the SuperTokens core to >= 3.15.0")
542554

543555
async def middleware(
544556
self, request: BaseRequest, response: BaseResponse, user_context: Dict[str, Any]
@@ -595,7 +607,8 @@ async def handle_without_rid():
595607
return None
596608
log_debug_message("middleware: Ended")
597609
return api_resp
598-
log_debug_message("middleware: Not handling because no recipe matched")
610+
log_debug_message(
611+
"middleware: Not handling because no recipe matched")
599612
return None
600613

601614
if request_rid is not None:
@@ -672,7 +685,8 @@ async def handle_supertokens_error(
672685
) -> Optional[BaseResponse]:
673686
log_debug_message("errorHandler: Started")
674687
log_debug_message(
675-
"errorHandler: Error is from SuperTokens recipe. Message: %s", str(err)
688+
"errorHandler: Error is from SuperTokens recipe. Message: %s", str(
689+
err)
676690
)
677691
if isinstance(err, GeneralError):
678692
raise err

0 commit comments

Comments
 (0)