Repository navigation
Conversation
… saved before Audiotool's sign-up or sign-in and the returning tab finishes the open (player/auth.js); until the live redirect URIs are registered, sign-up or sign-in with return_to the template Co-authored-by: David Querg <Que2039@users.noreply.github.com>
68 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Workstream 3 of the UX work plan (review issues 1 and 2): make "Open in Audiotool" as smooth as possible, and keep the visitor's sound through sign-up and sign-in.
What changes for the visitor
Where the OAuth sign-in works (
LOGIN_ORIGINS):localStoragebefore anything leaves the page. The OAuth sign-in then opens in a new tab. Audiotool's sign-in form has a "Sign up" link, and that link keeps the OAuth flow going (checked: it carries thelogin_challenge). The tab comes back to the a-plugins start page with?code. That page stores the tokens, builds the project from the saved snapshot, and moves on to Studio. The page the visitor played on is not touched.www.audiotool.com/a-plugins/a tiny dialog comes first: "Open DUCKquack in Audiotool", the line "Your sound comes along.", and two buttons, Create free account and Sign in. "Create free account" goes to Audiotool's signup page withreturn_toset to the same a-plugins page. That page then goes on to consent and finishes the open automatically.audiotool.github.iothere is no dialog. Audiotool's accounts rejectreturn_toaddresses on github.io, so the button goes straight to sign-in, whose form links to sign-up.Until the live redirect URIs are registered (today's live site): the button still links to the device's template, or to its plugin page where there is no template. On the first click, the tiny dialog sends the visitor to
accounts.audiotool.com/signup?return_to=<that link>or.../login?return_to=<that link>, which is Tribe's signup-first routing (buildStudioEntryHref). The visitor's UTM tags are copied onto the signup URL. After that first choice, clicks go straight to the link. "Add to project" stays hidden. Embedded players never show the dialog.Registration needed (outside this repo)
On Audiotool's OAuth server (Ory Hydra at
oauth.audiotool.com), add these redirect URIs to client83100fb3-489d-48db-ada2-16884a65473b:https://www.audiotool.com/a-plugins/https://audiotool.github.io/a-plugins/Each must match exactly, including the trailing slash. Today Hydra rejects both with "redirect_uri does not match any of the OAuth 2.0 Client's pre-registered redirect urls";
http://127.0.0.1:<port>/already works. Scope:project:write.Once they are registered:
?at-login=1. That switches the full flow on for that tab.scripts/data.mjs, setLOGIN_ORIGINS = ["http://127.0.0.1", ...LIVE_ORIGINS](or add one origin at a time), then rebuild withnode scripts/build.mjs --pages.Optional: if the Audiotool accounts team adds
https://audiotool.github.ioto the allowedreturn_toURLs, add it toSIGNUP_ORIGINSand github.io gets the "Create free account" choice too.Code
player/auth.js(new): PKCE, the token store, and pending records keyed by OAuthstate(TTL one hour). Also builds the signup, login and resume URLs, andfinishSignIn()for the redirect page.player/open.js: decides the route for each click, shows the handoff dialog, finishes a returning?codeor?at-resume, and puts a saved sound back.player/studio.js: replaces cross-tab polling with the redirect flow, addsfinishOpen(rec), and adds the two sign-in buttons to Add to project.player/main.js:player.restore(snapshot)applies the saved values and state before the interface and DSP start.scripts/data.mjs,scripts/pages.mjs:LIVE_ORIGINS,SIGNUP_ORIGINS, anddata-signup-originson every player.site/: rebuilt withA_PLUGINS_DATE=2026-11-30 node scripts/build.mjs --pages. The only differences are version hashes, the new attribute, the bundles and the CSS.Verification
--pagesbuild: 118 device pages, the same as before. It ran in a scratch copy because../native-nxsisn't available on the build machine; the generatedsite/diff was checked to contain only the changes above.auth.jswas exercised in Node with mockedlocalStorage,locationandfetch: the pending round trip, PKCEstateand verifier, signup and resume URLs with UTM tags, code exchange, refusal, unknown state, and expiry.Human checklist
Run locally with
npm run serveand openhttp://127.0.0.1:8095/(the full flow is on there), and also check the live origins.