mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-11-27 04:12:22 +00:00
6b87f53943
The panel side of short-code pairing. - New `/pairing` page (`views/pairing.ejs` + `public/js/pairing.js`) next to the existing QR activation flow: mint a code with an optional label, see the countdown, copy it, and revoke active codes. The plaintext code is shown once, because only its hash is stored. - `routes/pairing.routes.js` proxies mint/list/revoke to Go behind `requireAuth` and `enrollment.approve`; the client redeems directly against Go, so no code is ever handled by the panel's public API. - `wanSecurity.js` allows `/api/pairing/redeem` and `/api/pairing/config` on :21121 as POST only. Minting and listing stay off the public client API: a GET could spend somebody else's code via a link preview, and listing would expose code metadata. - `betterdeskApi` gains `createPairingCode`, `listPairingCodes`, `revokePairingCode`. - 28 new keys plus a `nav.pairing` entry in all 26 locale files. `scripts/check-pairing-i18n.js` enforces parity and runs in CI. Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)