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
{{ message }}
Repository navigation
feat: move auth and server helpers out of Next.js into a plain Node package #2564
The token exchange, refresh, and cookie handling in @faustwp/core is tied to Next.js (API routes, next/headers, the Next request/response types). Code outside Next.js (Astro, SvelteKit, a plain Node service, a CLI) can't reuse it, so each one reimplements the faustwp/v1/authorize flow.
Proposal
Extract the framework-agnostic parts into a plain Node package with no Next.js dependency:
Exchanging an authorization code or refresh token for tokens.
Refreshing tokens and tracking expiry.
Sending authenticated requests to WPGraphQL and REST.
@faustwp/core would then use this package and keep only the Next.js-specific glue. The roadmap's planned @wpengine/hwp-auth package looks like the right home, so this should line up with that work rather than add another package.
Acceptance
The package runs in plain Node with no Next.js installed.
@faustwp/core auth behavior is unchanged for existing users.
User login from Astro, SvelteKit, a plain Node service or other runtimes: WPGraphQL Headless Login on the WordPress side, with an established auth library such as Auth.js or Better Auth in the app.
@faustwp/core's auth for Next.js apps doesn't change. This also covers #1512, which was closed in favor of this issue.
Activity
josephfusco commentedon Oct 20, 2026
We've decided not to build a Faust.js auth package. Existing tools already cover authentication outside Next.js, and hwptoolkit's Headless Authentication guide recommends them:
@faustwp/core's auth for Next.js apps doesn't change. This also covers #1512, which was closed in favor of this issue.