fix: resume private share bundles after sign-in (Closes #1004)
CI / lint (pull_request) Successful in 2m53s
CI / build-release (pull_request) Successful in 6s
CI / browser-journey (pull_request) Successful in 2m30s
CI / release-candidate (pull_request) Has been skipped

This commit is contained in:
timmy committed 2026-08-17 06:25:58 +00:00
1 parent dc68305dcb
commit 7571a4aa2d
2 files changed
+49 -2

No files matched your search

+45
View File
@@ -569,6 +569,51 @@ async function destination(continuation) {{
}
def test_token_and_passkey_login_resume_only_the_private_share_bundle():
harness = f"""
const createLoginController = require({json.dumps(str(LOGIN_JS))});
const credential = {{
id:'credential-id', type:'public-key', rawId:Uint8Array.from([1]).buffer,
response:{{authenticatorData:Uint8Array.from([2]).buffer,
clientDataJSON:Uint8Array.from([3]).buffer,
signature:Uint8Array.from([4]).buffer,userHandle:null}},
}};
async function destination(continuation, authentication) {{
let replaced = null;
const controller = createLoginController({{
form:{{reset:()=>{{}}}}, status:{{textContent:''}}, button:{{disabled:false}},
passkeyButton:{{disabled:false}}, credentials:{{get:async()=>credential}},
fetchImpl:async url => url.endsWith('/options')
? new Response(JSON.stringify({{challenge:'AQID',allowCredentials:[]}}),
{{status:200,headers:{{'Content-Type':'application/json'}}}})
: new Response('{{}}',{{status:200}}),
location:{{replace:value=>replaced=value}}, continuation,
}});
if (authentication === 'passkey') await controller.signInWithPasskey('Phone');
else await controller.submit('operator-token');
return replaced;
}}
(async()=>process.stdout.write(JSON.stringify({{
token:await destination('./?launch=new&shared=bundle','token'),
passkey:await destination('./?launch=new&shared=bundle','passkey'),
extra:await destination('./?launch=new&shared=bundle&title=leak','token'),
duplicate:await destination('./?launch=new&shared=bundle&shared=bundle','token'),
wrongLaunch:await destination('./?launch=agenda&shared=bundle','token'),
}})))().catch(error=>{{console.error(error);process.exit(1);}});
"""
result = subprocess.run(
["node", "-e", harness], text=True, capture_output=True, check=True
)
assert json.loads(result.stdout) == {
"token": "./?launch=new&shared=bundle",
"passkey": "./?launch=new&shared=bundle",
"extra": "./",
"duplicate": "./",
"wrongLaunch": "./",
}
@pytest.mark.anyio
async def test_login_page_loads_rate_limit_controller():
html = await login()