Skip to content

fix: load env before auth schema config#379

Merged
onmax merged 2 commits into
mainfrom
fix/issue-377-env-auth-config
Jun 30, 2026
Merged

fix: load env before auth schema config#379
onmax merged 2 commits into
mainfrom
fix/issue-377-env-auth-config

Conversation

@onmax

@onmax onmax commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Loads the project .env.local before the schema generator imports server/auth.config.ts, so top-level SDK constructors in imported email or provider helpers can see local API keys during NuxtHub schema generation.

The failure came from schema generation importing the auth config before the env file used by the CLI path was available to process.env. Passing Nuxt rootDir into the shared loader fixes the import path once and preserves existing process.env values.

Closes #377

@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
nuxt-better-auth-docs Ready Ready Preview, Comment Jun 30, 2026 8:15am

@pkg-pr-new

pkg-pr-new Bot commented Jun 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@onmax/nuxt-better-auth@379

commit: 279ee93

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 30, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
better-auth 20dc0ce Jun 30 2026, 08:16 AM

@onmax onmax marked this pull request as ready for review June 30, 2026 06:07
@onmax onmax force-pushed the fix/issue-377-env-auth-config branch from a4e17e3 to 279ee93 Compare June 30, 2026 07:56
@onmax onmax marked this pull request as draft June 30, 2026 07:59
@onmax onmax marked this pull request as ready for review June 30, 2026 08:01
@onmax onmax merged commit 0fbb648 into main Jun 30, 2026
3 of 5 checks passed
@onmax onmax deleted the fix/issue-377-env-auth-config branch June 30, 2026 08:13
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.

Migration error with .env 3rd party API keys

1 participant