Skip to content

feat(vendors): add Directus and Medusa to the cookie registry - #12

Merged
matt-rolley merged 1 commit into
mainfrom
feat/directus-medusa-vendors
Apr 21, 2026
Merged

matt-rolley merged 1 commit into
mainfrom
feat/directus-medusa-vendors

Conversation

@matt-rolley

Copy link
Copy Markdown
Contributor

Summary

Two new vendor entries for the `cookiePolicy.vendors` registry.

Directus

Two `necessary` cookies set after the user authenticates:

  • `directus_session_token` — signed session JWT, 1 day.
  • `directus_refresh_token` — refresh token for silent re-auth, 7 days.

Source: `directus/directus` `api/src/controllers/auth.ts` + `api/src/constants.ts`. Defaults to cookie mode when `mode: 'cookie'` or `mode: 'session'` are used on login — the common SSR pattern.

Medusa

Medusa v2's default is JWT-in-localStorage, not cookies. Two entries:

  • `medusa_auth_token` (`HTML Local Storage`, Persistent) — default storefront auth.
  • `connect.sid` (`HTTP`, Session) — only set when the backend opts into `auth.type = 'session'` (non-default).

Including both so users on either auth mode get an accurate policy table. The purpose text flags `connect.sid` as "only when session auth is enabled" so visitors reading the policy understand when it applies.

Incidental fix

The "Available vendors" list in `docs/guide/configuration.md` was missing four vendors that had been added to the registry previously (`youtube`, `vimeo`, `cloudflare`, `cloudflare-turnstile`). Brought the list back in sync.

Test plan

  • `pnpm test` — 90/90. The registry tests assert structural invariants (unique IDs, ≥1 cookie per vendor, all fields present) — all covered by the new entries.
  • `pnpm lint` — clean.
  • Sanity-check in the playground: add `directus` and `medusa` to the `cookiePolicy.vendors` array in `playground/nuxt.config.ts`, confirm they render in the cookie policy table.

Follow-up ideas (not in this PR)

  • If user feedback suggests it, expand Directus with an `HTML Local Storage` entry for the JS SDK's `localStorage` mode (`directus-data` / similar).
  • Consider marking `medusa_auth_token` with a comment that it's optional-to-disclose — it's a strictly-necessary auth token the user opts into by logging in.

Directus ships two necessary auth cookies (directus_session_token,
directus_refresh_token) when an authenticated user is present.

Medusa v2 defaults to JWT-in-localStorage (medusa_auth_token) rather
than cookies. connect.sid is included for sites that opt into the
non-default session auth mode.

Also fixes the Available Vendors list in configuration.md, which was
missing youtube, vimeo, cloudflare, and cloudflare-turnstile that had
been added to the registry previously.
@vercel

vercel Bot commented Apr 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nuxt-c15t Ready Ready Preview, Comment Apr 21, 2026 8:31am

Request Review

@matt-rolley
matt-rolley merged commit 02c16b1 into main Apr 21, 2026
3 checks passed
@matt-rolley
matt-rolley deleted the feat/directus-medusa-vendors branch April 21, 2026 08:33

This branch was successfully deployed

1 active deployment
Preview — 72670c2a Deployed Apr 21, 2026 by vercel[bot]
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.

1 participant