Skip to content

fix: expose client_id in device flow discovery response - #251

Merged
ascorbic merged 4 commits into
emdash-cms:mainfrom
yohaann196:main
Apr 11, 2026
Merged

ascorbic merged 4 commits into
emdash-cms:mainfrom
yohaann196:main

Conversation

@yohaann196

Copy link
Copy Markdown
Contributor

What does this PR do?

The /_emdash/.well-known/auth discovery endpoint was missing client_id from the device_flow object. The CLI needs this value to initiate the device authorization flow — without it, GitHub device flow authentication fails. The CLI already used "emdash-cli" as a hardcoded fallback; this makes it the canonical advertised value in the discovery response.

Closes #157

Type of change

Checklist

AI-generated code disclosure

  • This PR includes AI-generated code

Screenshots / test output

One line added to packages/core/src/astro/routes/api/well-known/auth.ts:

 device_flow: !isExternal
   ? {
+      client_id: "emdash-cli",
       device_authorization_endpoint: "/_emdash/api/oauth/device/code",
       token_endpoint: "/_emdash/api/oauth/device/token",
     }
   : undefined,

Copilot AI review requested due to automatic review settings April 4, 2026 22:31
@changeset-bot

changeset-bot Bot commented Apr 4, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2e5fcf9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/plugin-ai-moderation Patch
@emdash-cms/plugin-atproto Patch
@emdash-cms/plugin-audit-log Patch
@emdash-cms/plugin-color Patch
@emdash-cms/plugin-embeds Patch
@emdash-cms/plugin-forms Patch
@emdash-cms/plugin-webhook-notifier Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Apr 4, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@yohaann196

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Apr 4, 2026
@yohaann196

Copy link
Copy Markdown
Contributor Author

recheck

@yohaann196

Copy link
Copy Markdown
Contributor Author

fixes #157

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Exposes the CLI OAuth Device Flow client_id in the /_emdash/.well-known/auth discovery response so clients can reliably initiate the device authorization flow without hardcoding the value.

Changes:

  • Add client_id: "emdash-cli" to the auth.methods.device_flow object in the discovery endpoint response.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ascorbic ascorbic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pkg-pr-new

pkg-pr-new Bot commented Apr 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@251

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@251

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@251

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@251

emdash

npm i https://pkg.pr.new/emdash@251

create-emdash

npm i https://pkg.pr.new/create-emdash@251

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@251

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@251

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@251

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@251

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@251

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@251

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@251

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@251

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@251

commit: 2e5fcf9

@ascorbic
ascorbic merged commit a13c4ec into emdash-cms:main Apr 11, 2026
24 of 25 checks passed
This was referenced Apr 11, 2026
fmhall pushed a commit to fmhall/emdash that referenced this pull request Apr 13, 2026
* Add client_id to device flow configuration

* chore: add changeset

---------

Co-authored-by: Matt Kane <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub device flow fails — clientId missing from auth discovery

3 participants