You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
Device-code sign-in for a device that cannot type in (an Apple TV), behind the new features.device_code toggle. Two screens and two controllers. The TV screen (auth.device_code, MagicStarterDeviceCodeView, guest route /auth/device) asks POST auth/device/code for a pair, shows the XXXX-XXXX code, the verification address and a QR code of the address with the code in it, then polls POST auth/device/token, never sooner than interval seconds after the previous answer, and concludes through completeSignIn; a declined or expired code, or a success that does not read as a session, stops the poll and offers "Get a new code", and nothing is issued again unless the viewer asks. The approval screen (auth.device_approve, MagicStarterDeviceApproveView, route /auth/device/approve?code= behind auth) runs on a signed-in phone: opening it only looks the code up, it shows the client and the name the TV gave itself under one "reported by the device" marker (both come from the device), then the server's own facts (both countries and the age of the code), and gives Approve and Deny the same intent and size. Approve acts only on the code whose facts are on screen; a different typed code is looked up first. Every code in the route is treated as a link code whatever its entry query says, so a forwarded URL cannot skip the typing step: from another network it is cleared and must be typed from the TV. A strong warning naming both countries shows whenever the facts say another network, typed code or link. A request with no answer leaves the screen retryable, an answer from a superseded visit is dropped, and an account with two-factor confirmed is asked for proof through confirmIdentity on a 423. MagicStarterConfig.hasDeviceCodeFeatures(), deviceCodeRoute() and deviceApproveRoute() read the toggle and the two paths, the config helper and the install stubs know the key, and the English strings ship under magic_starter.device_code.*, magic_starter.device_approve.* and magic_starter.titles.device_code / device_approve; an app installed earlier merges them into its own lang files from assets/stubs/install/en.stub. While device_code is on, EnsureAuthenticated treats the TV screen's path as a guest route and records no intended url for it; with the toggle off it records that path as before, so a host's own page there is unaffected. It needs the device-code feature on magic-starter-laravel. The screen draws the QR code with the new direct dependency pretty_qr_code: ^3.6.0. lib/src/http/controllers/magic_starter_device_code_controller.dart, lib/src/http/controllers/magic_starter_device_approve_controller.dart, lib/src/ui/views/auth/magic_starter_device_code_view.dart, lib/src/ui/views/auth/magic_starter_device_approve_view.dart, lib/src/routes/auth_routes.dart, lib/src/magic_starter_manager.dart, lib/src/configuration/magic_starter_config.dart, lib/config/magic_starter.dart, assets/stubs/install/, pubspec.yaml, doc/basics/device-code-sign-in.md, doc/basics/authentication.md, doc/getting-started/configuration.md, doc/getting-started/installation.md, doc/architecture/manager.md, doc/architecture/controllers.md, skills/magic-starter/