Skip to content

refactor(data-inspector): use devframe_auth_token for the SPA handshake param - #151

Merged
antfu merged 1 commit into
mainfrom
refactor/auth-token-query-param
Jul 31, 2026
Merged

refactor(data-inspector): use devframe_auth_token for the SPA handshake param#151
antfu merged 1 commit into
mainfrom
refactor/auth-token-query-param

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

What

Rename the Data Inspector standalone attach URL's auth-token query param from the bespoke di_token to devframe core's canonical devframe_auth_token.

Why

devframe core already defines DEVFRAME_AUTH_TOKEN_QUERY_PARAM = 'devframe_auth_token' (packages/devframe/src/constants.ts), and the WebSocket transport already appends ?devframe_auth_token= to the socket URL. Data Inspector was minting and consuming its own di_token name, so the CLI producer, the SPA consumer, and the underlying socket handshake used two different names for the same secret. This aligns them on one name and one source of truth by importing the shared constant instead of hardcoding a string.

Changes

  • cli.ts — the printed attach URL now emits ?devframe_auth_token=<token> via the shared constant.
  • spa/composables/rpc.tsconsumeAuthToken() reads and scrubs devframe_auth_token using the same constant.

Note

This changes the standalone handshake contract: a stale/bookmarked URL carrying ?di_token= will no longer authenticate. Since the CLI mints the URL fresh on each attach, this only affects old copied links.


This PR was created with the help of an agent.

…ke param

Align the standalone attach URL's token param with devframe core's canonical
DEVFRAME_AUTH_TOKEN_QUERY_PARAM ('devframe_auth_token'), which the WS transport
already uses, so the CLI producer, the SPA consumer, and the socket handshake
share one name and one source of truth instead of the bespoke di_token.
@netlify

netlify Bot commented Jul 31, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit 224f2e3
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a6c34c05acc1100072e29db
😎 Deploy Preview https://deploy-preview-151--devfra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@antfu
antfu merged commit c0e4715 into main Jul 31, 2026
10 of 12 checks passed
@antfu
antfu deleted the refactor/auth-token-query-param branch July 31, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants