Skip to content

Commit dfe9fba

Browse files
committed
chores: Run formatter
1 parent 32501bd commit dfe9fba

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

supertokens_python/recipe/session/asyncio/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ async def get_session_without_request_response(
333333
- you can disable anti-csrf checks by setting antiCsrf to NONE in the Session recipe config. We only recommend this if you are always getting the access-token from the Authorization header.
334334
- if the antiCsrf check fails the returned status will be TRY_REFRESH_TOKEN_ERROR
335335
336-
args:
336+
Args:
337337
- access_token: The access token extracted from the authorization header or cookies
338338
- anti_csrf_token: The anti-csrf token extracted from the authorization header or cookies. Can be undefined if antiCsrfCheck is false
339339
- anti_csrf_check: If true, anti-csrf checking will be done. If false, it will be skipped. Defaults behaviour to check.
@@ -348,8 +348,6 @@ async def get_session_without_request_response(
348348
- You can send a 401 response to trigger this behaviour if you are using our frontend SDKs
349349
- GetSessionUnauthorizedErrorResult: This means that the access token likely doesn't belong to a SuperTokens session. If this is unexpected, it's best handled by sending a 401 response.
350350
"""
351-
352-
353351
if user_context is None:
354352
user_context = {}
355353

@@ -372,7 +370,9 @@ async def get_session_without_request_response(
372370
await res.session.assert_claims(claim_validators, user_context)
373371
except SuperTokensError as e:
374372
if isinstance(e, InvalidClaimsError):
375-
return GetSessionClaimValidationErrorResult(e) # FIXME: is this correct?
373+
return GetSessionClaimValidationErrorResult(
374+
e
375+
) # FIXME: is this correct?
376376
raise e
377377

378378
return res

supertokens_python/recipe/session/interfaces.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@
3030
from supertokens_python.types import APIResponse, GeneralErrorResponse, MaybeAwaitable
3131

3232
from ...utils import resolve
33-
from .exceptions import ClaimValidationError, UnauthorisedError, TokenTheftError, TryRefreshTokenError, \
34-
InvalidClaimsError
33+
from .exceptions import (
34+
ClaimValidationError,
35+
UnauthorisedError,
36+
TokenTheftError,
37+
TryRefreshTokenError,
38+
InvalidClaimsError,
39+
)
3540
from .utils import SessionConfig, TokenTransferMethod
3641

3742
if TYPE_CHECKING:
@@ -85,6 +90,7 @@ def __init__(self, request: BaseRequest, transfer_method: TokenTransferMethod):
8590

8691
self.response_mutators = [] # TODO: Use this everywhere!
8792

93+
8894
class CreateNewSessionResult:
8995
status = "OK"
9096

supertokens_python/recipe/session/recipe_implementation.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,7 @@ async def get_session(
320320
log_debug_message(
321321
"getSession: Returning TRY_REFRESH_TOKEN_ERROR because of an exception during get_session"
322322
)
323-
return GetSessionUnauthorizedErrorResult(
324-
e
325-
) # FIXME: Is this correct?
323+
return GetSessionUnauthorizedErrorResult(e) # FIXME: Is this correct?
326324

327325
log_debug_message(
328326
"getSession: Returning UNAUTHORISED because of an exception during get_session"

supertokens_python/recipe/session/session_request_functions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ async def get_session_from_request(
188188
)
189189

190190
if isinstance(
191-
result, (GetSessionTryRefreshTokenErrorResult, GetSessionUnauthorizedErrorResult)
191+
result,
192+
(GetSessionTryRefreshTokenErrorResult, GetSessionUnauthorizedErrorResult),
192193
):
193194
raise result.error
194195

0 commit comments

Comments
 (0)