Repository navigation
Telegram: approve a sign-in on another device from the account page, and the list of signed-in devices - #20
Merged
Conversation
…by scanning its QR code or pasting its link, with a warning and a deliberate second press, then its device, app and place and a way to sign it out; and the list of signed-in devices, each but this hub's with a sign-out Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
So the owner can remove the Telegram app from their phone: Telegram asks a device that is already signed in to approve each new sign-in, by scanning the QR code the new device shows. A Telegram account's page here can now be that device. It uses the actions dither-accounts' Telegram extractor gained in 7d072ac (
approveLogin,sessions,endSession) through the existingPOST /api/accounts/:id/action. There are no hub or protocol changes.What changed
ui/TelegramSignIns.tsx). It works only while the account is online; before that, the buttons are off and it says why.sessionsgives.current) comes first, is marked "This hub", and has no sign-out.BarcodeDetectorwhere the browser has one, otherwise by jsQR 1.4.0 (Apache-2.0), a separate chunk (130 kB, 48 kB gzip) loaded only when a scanner opens. It is not in the service worker's precache.tg://login?token=…link, or choose a picture of the code (a screenshot, say).tg://login?token=links go further (tglogin.ts). Anything else shows "That is not a Telegram sign-in code…".step()intglogin.ts, unit-tested).endSession {hash}).Android
No change needed.
MainActivity.onPermissionRequestalready mapsRESOURCE_VIDEO_CAPTUREtoCAMERA(used by calls), and the manifest already declaresandroid.permission.CAMERA. The WebView therefore asks Android for the camera and grants it to the hub's page. If the user refuses, the page shows the refusal message and the paste field still works. I didn't run it on a device.How it was verified
bun run typecheckandbun run test: all packages pass. New:packages/web/test/tglogin.test.tscovers the link check, place and app text, the approve steps (no approval before arming or without a press), and the undo-blocked window.scripts/verify-telegram-approve.ts, run against a throwaway dither-accounts manager (7d072ac,TELEGRAM_FAKE=1, fresh data dir) and a throwaway hub in remote mode (fresh data dir). It uses headless Chromium with a fake camera that plays a generated QR code (Y4M). All checks pass. They cover:sessionssays to sign in first;ageSession;What I could not verify
BarcodeDetector: headless Linux Chromium doesn't have it, so the camera and picture runs went through jsQR. The native path is plain API use, untested here.MainActivityand by the 390 px emulation.🤖 Generated with Claude Code