nextauthjs / next-auth

Authentication for the Web.
https://authjs.dev
ISC License
25k stars 3.53k forks source link

fix: improve client-side submodules #12249

Closed balazsorban44 closed 6 days ago

balazsorban44 commented 6 days ago

☕️ Reasoning

  1. Improved provider id inference in signIn method.
    • Generate known email provider id types
    • simplify inference by dropping LiteralUnion type
  2. Allow redirect: false for OAuth providers in client-side signIn. We already allowed this for the server-side version. In some cases, you might just want the URL before redirecting via window.location.href, eg. you want to use a popup window to initiate the signin.
  3. Improved return type of signIn and signOut methods. Now, unless redirect: false is explicitly added, these methods will return void.
  4. throw proper errors when WebAuthn signin is initiated from the wrong import. This gives early feedback to the developer
  5. Unify API across framework integrations with client-side methods. (Looks like there is a lot of overlap, that we could consolidate via adding @auth/core/client)

🧢 Checklist

🎫 Affected issues

📌 Resources

vercel[bot] commented 6 days ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 16, 2024 0:13am
2 Skipped Deployments | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **next-auth-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/authjs/next-auth-docs/2o6FxXLPeM4KWXeiRe8rU6a6YtUR)) | [Visit Preview](https://next-auth-docs-git-fix-types-and-redirects-authjs.vercel.app) | | Nov 16, 2024 0:13am | | **proxy** | ⬜️ Ignored ([Inspect](https://vercel.com/authjs/proxy/7sUwfHd7HcBUt6m8jbvetwZvJHA8)) | [Visit Preview](https://proxy-git-fix-types-and-redirects-authjs.vercel.app) | | Nov 16, 2024 0:13am |
codecov[bot] commented 6 days ago

Codecov Report

Attention: Patch coverage is 0.66079% with 451 lines in your changes missing coverage. Please review.

Project coverage is 39.64%. Comparing base (1c37d92) to head (08162cb). Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
packages/frameworks-sveltekit/src/lib/client.ts 0.00% 126 Missing :warning:
packages/frameworks-solid-start/src/client.ts 0.00% 84 Missing :warning:
packages/frameworks-sveltekit/src/lib/webauthn.ts 0.00% 76 Missing :warning:
packages/next-auth/src/react.tsx 0.00% 68 Missing :warning:
packages/next-auth/src/webauthn.ts 0.00% 64 Missing :warning:
packages/core/src/providers/index.ts 0.00% 11 Missing :warning:
packages/next-auth/src/lib/client.ts 0.00% 11 Missing :warning:
packages/frameworks-sveltekit/src/lib/types.ts 0.00% 8 Missing :warning:
packages/core/src/providers/email.ts 0.00% 2 Missing :warning:
packages/core/src/providers/oauth.ts 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #12249 +/- ## ========================================== - Coverage 39.77% 39.64% -0.13% ========================================== Files 192 192 Lines 30371 30460 +89 Branches 1337 1337 ========================================== - Hits 12079 12076 -3 - Misses 18292 18384 +92 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.