A CLI for publishing standard.site documents to ATProto sequoia.pub
standard site lexicon cli publishing

Send referrer path and origin through login flow #36

merged opened by heaths.dev targeting main from heaths.dev/sequoia: referrer-policy
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:tg3tb5wukiml4xmxml6qm637/sh.tangled.repo.pull/3mfvsjr6jym22
+9 -2
Diff #0
+9 -2
packages/cli/src/components/sequoia-subscribe.js
··· 258 258 method: "POST", 259 259 headers: { "Content-Type": "application/json" }, 260 260 credentials: "include", 261 + referrerPolicy: "no-referrer-when-downgrade", 261 262 body: JSON.stringify({ publicationUri }), 262 263 }); 263 264 264 265 const data = await response.json(); 265 266 266 267 if (response.status === 401 && data.authenticated === false) { 267 - // Redirect to the hosted subscribe page to complete OAuth 268 - window.location.href = data.subscribeUrl; 268 + // Redirect to the hosted subscribe page to complete OAuth, 269 + // passing the current page URL (without credentials) as returnTo. 270 + const subscribeUrl = new URL(data.subscribeUrl); 271 + const pageUrl = new URL(window.location.href); 272 + pageUrl.username = ""; 273 + pageUrl.password = ""; 274 + subscribeUrl.searchParams.set("returnTo", pageUrl.toString()); 275 + window.location.href = subscribeUrl.toString(); 269 276 return; 270 277 } 271 278

History

1 round 0 comments
sign up or login to add to the discussion
heaths.dev submitted #0
1 commit
expand
Send referrer path and origin through login flow
expand 0 comments
pull request successfully merged