@mathismeadows/roamer-device-auth 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mathismeadows/roamer-device-auth",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "private": false,
5
5
  "mcpName": "com.mathismeadows/roamer-mcp",
6
6
  "type": "module",
@@ -312,8 +312,15 @@ async function refreshTokens(refreshToken) {
312
312
  return response.json();
313
313
  }
314
314
 
315
- async function startDeviceFlow() {
316
- const response = await fetch(`${ROAMER_MCP_ORIGIN}/oauth/device/start`, { method: "POST" });
315
+ // AUTH-52: carries the same client identity the loopback flow already sends at DCR
316
+ // registration, so the server's device-code confirm/success/failure/contact-email pages can
317
+ // name which client each sign-in prompt is actually for, instead of a generic message.
318
+ async function startDeviceFlow(clientSlug) {
319
+ const response = await fetch(`${ROAMER_MCP_ORIGIN}/oauth/device/start`, {
320
+ method: "POST",
321
+ headers: { "Content-Type": "application/json" },
322
+ body: JSON.stringify({ client_name: clientSlug }),
323
+ });
317
324
  if (!response.ok) {
318
325
  throw new Error(`Device flow start failed: ${response.status} ${await response.text()}`);
319
326
  }
@@ -392,7 +399,7 @@ async function doGetValidTokens(clientSlug, forceRefresh) {
392
399
  let resuming = Boolean(device);
393
400
  if (!resuming) {
394
401
  log("Starting sign-in...");
395
- device = await startDeviceFlow();
402
+ device = await startDeviceFlow(clientSlug);
396
403
  await writePendingFlow(clientSlug, device);
397
404
  } else {
398
405
  log("Resuming an already-in-progress sign-in (a prior process was restarted before it finished)...");