@@ -4989,7 +4989,7 @@ async def test_invitation_and_org_forwarded_to_authorize(mocker):
49894989 url = await client .start_interactive_login (
49904990 StartInteractiveLoginOptions (
49914991 organization = "org_abc123" ,
4992- invitation = " inv_token_xyz" ,
4992+ authorization_params = { "invitation" : " inv_token_xyz"} ,
49934993 )
49944994 )
49954995
@@ -5001,7 +5001,6 @@ async def test_invitation_and_org_forwarded_to_authorize(mocker):
50015001 assert stored .organization == "org_abc123"
50025002
50035003
5004-
50055004@pytest .mark .asyncio
50065005async def test_invitation_without_org_forwarded_to_authorize (mocker ):
50075006 """invitation alone appears in the URL; no organization param."""
@@ -5021,41 +5020,14 @@ async def test_invitation_without_org_forwarded_to_authorize(mocker):
50215020 "authorization_endpoint" : "https://tenant.auth0.com/authorize" ,
50225021 })
50235022
5024- url = await client .start_interactive_login (
5025- StartInteractiveLoginOptions (invitation = "inv_token_xyz" )
5026- )
5027-
5028- assert "invitation=inv_token_xyz" in url
5029- assert "organization=" not in url
5030-
5031-
5032- @pytest .mark .asyncio
5033- async def test_invitation_via_authorization_params_dict_is_ignored (mocker ):
5034- """invitation passed via authorization_params dict is stripped; typed field is the only path."""
5035- mock_tx_store = AsyncMock ()
5036- mock_state_store = AsyncMock ()
5037- client = ServerClient (
5038- domain = "tenant.auth0.com" ,
5039- client_id = "test_client" ,
5040- client_secret = "test_secret" ,
5041- redirect_uri = "https://app.example.com/callback" ,
5042- transaction_store = mock_tx_store ,
5043- state_store = mock_state_store ,
5044- secret = "test_secret_key_32_chars_long!!" ,
5045- )
5046- mocker .patch .object (client , "_get_oidc_metadata_cached" , return_value = {
5047- "issuer" : "https://tenant.auth0.com/" ,
5048- "authorization_endpoint" : "https://tenant.auth0.com/authorize" ,
5049- })
5050-
50515023 url = await client .start_interactive_login (
50525024 StartInteractiveLoginOptions (
5053- authorization_params = {"invitation" : "inv_via_dict" },
5025+ authorization_params = {"invitation" : "inv_token_xyz" }
50545026 )
50555027 )
50565028
5057- parsed = parse_qs ( urlparse ( url ). query )
5058- assert "invitation " not in parsed
5029+ assert "invitation=inv_token_xyz" in url
5030+ assert "organization= " not in url
50595031
50605032
50615033@pytest .mark .asyncio
0 commit comments