amber-backend/pb_hooks/web.pb.js
Claude 12e7f4103f The unified page becomes the site; retire the two it replaced
index.html was the old landing page with a signup form, and that form can now only
fail — registration is owner-only. A dead button is worse than no button, so the
unified account page takes its place rather than sitting beside it. settings.html
goes too: it is a strict subset of the sources section, and onboarding.html was the
signup wizard.

Verified against the live backend before the swap, signed in as a throwaway account
created the way the owner now creates them (and deleted afterwards — the instance is
back to its five real accounts):

  registration    403 "Only superusers can perform this action", with and without
                  the old invite header
  template route  401 anonymously
  session         survives a full page reload; the password does NOT, so the
                  sources section re-asks for it — the intended split
  prefs           one row, updatedAt distinct from the server cursor, and all 13
                  fields present including the three the page does not render, so
                  the merge did not clobber what the app writes
  sources (BYOC)  the browser reached the addon's /encode cross-origin, minted the
                  prehraj.to token, built TorBox's config locally, encrypted and
                  saved; the stored blob contains no plaintext and carries
                  kdf=pbkdf2-sha256-210000
  downloads       all three platforms resolve to 1.1.6 · clean with a file token

Checked rather than assumed: the Czech URL is stored with /manifest.json (matching
the existing template) and the app strips it on both read and write via
_stripManifest, so minting it that way is correct and not a latent 404.
2026-08-07 02:10:48 +02:00

24 lines
1.1 KiB
JavaScript

/// <reference path="../pb_data/types.d.ts" />
// Pretty URLs for the family-facing web surfaces.
//
// One page now does what three did: `index.html` is sign-in, profiles,
// playback preferences, sources, devices and downloads behind a persisted
// session. `/settings` keeps working because it is in people's muscle memory and
// in older messages — it lands on the sources section of the new page.
//
// `/tv` is the short form of `/get/tv`, because that URL gets typed on a
// television remote inside the Downloader app, one character at a time.
//
// `onboarding.html` and `settings.html` are gone rather than left lying around.
// The first offered a signup form that can now only fail — registration is
// owner-only — and a dead button is worse than no button. The second is a subset
// of the sources section.
routerAdd("GET", "/account", (e) => e.redirect(302, "/"))
// Deep-link straight to sources; the page reads the hash to pick its tab.
routerAdd("GET", "/settings", (e) => e.redirect(302, "/#addons"))
// Typing this on a remote is the actual cost being optimised.
routerAdd("GET", "/tv", (e) => e.redirect(302, "/get/tv"))