@@ -1081,7 +1081,11 @@ def authenticate_with_code(
10811081 ip_address : Optional [str ] = None ,
10821082 user_agent : Optional [str ] = None ,
10831083 ) -> AuthKitAuthenticationResponse :
1084- if session is not None and session .get ("seal_session" ) and not session .get ("cookie_password" ):
1084+ if (
1085+ session is not None
1086+ and session .get ("seal_session" )
1087+ and not session .get ("cookie_password" )
1088+ ):
10851089 raise ValueError ("cookie_password is required when sealing session" )
10861090
10871091 payload : AuthenticateWithCodeParameters = {
@@ -1182,7 +1186,11 @@ def authenticate_with_refresh_token(
11821186 ip_address : Optional [str ] = None ,
11831187 user_agent : Optional [str ] = None ,
11841188 ) -> RefreshTokenAuthenticationResponse :
1185- if session is not None and session .get ("seal_session" ) and not session .get ("cookie_password" ):
1189+ if (
1190+ session is not None
1191+ and session .get ("seal_session" )
1192+ and not session .get ("cookie_password" )
1193+ ):
11861194 raise ValueError ("cookie_password is required when sealing session" )
11871195
11881196 payload : AuthenticateWithRefreshTokenParameters = {
@@ -1680,7 +1688,11 @@ async def authenticate_with_code(
16801688 ip_address : Optional [str ] = None ,
16811689 user_agent : Optional [str ] = None ,
16821690 ) -> AuthKitAuthenticationResponse :
1683- if session is not None and session .get ("seal_session" ) and not session .get ("cookie_password" ):
1691+ if (
1692+ session is not None
1693+ and session .get ("seal_session" )
1694+ and not session .get ("cookie_password" )
1695+ ):
16841696 raise ValueError ("cookie_password is required when sealing session" )
16851697
16861698 payload : AuthenticateWithCodeParameters = {
@@ -1789,7 +1801,11 @@ async def authenticate_with_refresh_token(
17891801 ip_address : Optional [str ] = None ,
17901802 user_agent : Optional [str ] = None ,
17911803 ) -> RefreshTokenAuthenticationResponse :
1792- if session is not None and session .get ("seal_session" ) and not session .get ("cookie_password" ):
1804+ if (
1805+ session is not None
1806+ and session .get ("seal_session" )
1807+ and not session .get ("cookie_password" )
1808+ ):
17931809 raise ValueError ("cookie_password is required when sealing session" )
17941810
17951811 payload : AuthenticateWithRefreshTokenParameters = {
0 commit comments