Skip to content

feat: remove react from next-auth, move to vue - #1

Merged
phoenix-ru merged 36 commits into
v4from
feat/remove-react
Oct 20, 2026
Merged

phoenix-ru merged 36 commits into
v4from
feat/remove-react

Conversation

@phoenix-ru

@phoenix-ru phoenix-ru commented Mar 13, 2026 •

Copy link
Copy Markdown
Member

☕️ Reasoning

This PR removes react, preact and next dependencies from the next-auth package, replacing the functionality with vue instead, for better integration with NuxtAuth.

⚠️ Updated nodemailer peer support to allow newer patched releases and avoid known audit findings from older 7.x versions. Consumers using advanced Nodemailer options should review the breaking changes in 8.0 and 9.0, especially auth error codes and stricter TLS validation for remote content/OAuth/proxy requests.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

📌 Resources

@pkg-pr-new

pkg-pr-new Bot commented Apr 10, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@sidebase/fork-authjs@1
pnpm add https://pkg.pr.new/@sidebase/fork-authjs@1
yarn add https://pkg.pr.new/@sidebase/fork-authjs@1.tgz

commit: 82d6abc

phoenix-ru and others added 9 commits April 10, 2026 14:54
The inline email normalizer validated the address on the ASCII `@` before any
Unicode normalization. A character that is a homoglyph of `@` — e.g. U+FF20
FULLWIDTH COMMERCIAL AT — passed the single-`@` (atCount) check, but can be
canonicalized to an ASCII `@` by a downstream address parser (NFKC), splitting
the address into multiple recipients (CWE-180: validate before canonicalize).

Apply `String.prototype.normalize("NFKC")` before validation so any such
homoglyph becomes a real `@` and is rejected by the existing atCount check.
Behaviour on legitimate addresses is unchanged. Adds a regression test.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 19d2feb)
`detectOrigin` returned the auto-detected forwarded host whenever
`VERCEL`/`AUTH_TRUST_HOST` was set, ignoring an explicitly configured
`NEXTAUTH_URL`. A configured canonical URL should always win; only fall
back to the forwarded host when no `NEXTAUTH_URL` is set.

Adds unit tests for detectOrigin precedence.

(cherry picked from commit 2a39465)
Comment thread packages/next-auth/package.json Outdated
Comment thread packages/next-auth/tsconfig.build.json Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread packages/next-auth/package.json Outdated
Comment thread packages/next-auth/src/core/pages/signout.ts Outdated
// If `NEXTAUTH_URL` is `undefined` we fall back to "http://localhost:3000"
// `NEXTAUTH_URL` is `undefined` here; callers fall back to
// "http://localhost:3000".
return process.env.NEXTAUTH_URL

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.

Q: Should we return undefined here? Since "" its also "falsy" we might return "" and not undefined

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I considered doing this and decided not to:

NEXTAUTH_URL detectOrigin() parseUrl()
Unset undefined http://localhost:3000/api/auth
"" "" TypeError: Invalid URL
"https://app.example.test" Configured URL https://app.example.test/api/auth

The reason being is that TypeError which I think is better than silently defaulting to localhost when NEXTAUTH_URL= was provided, would you agree?

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.

Sounds good, but should we adjust the comment here? (just as nit) Currently says: NEXTAUTH_URL is undefined here; callers fall back to "http://localhost:3000". which is not 100% correct.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is taken from the upstream package, so I'd prefer to keep it synced despite it being not fully correct: https://github.com/nextauthjs/next-auth/blob/d857eec560fb99c8b18d3b22a2693b849a62d1c3/packages/next-auth/src/utils/detect-origin.ts#L14-L16

Comment thread packages/next-auth/src/jwt/index.ts Outdated
Comment thread packages/next-auth/src/jwt/index.ts Outdated
@phoenix-ru
phoenix-ru merged commit 61994c7 into v4 Oct 20, 2026
4 checks passed
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.

3 participants