@neondatabase/auth 0.2.0-beta.1 → 0.4.0-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +22 -7
  3. package/codemods/migrate-auth-ui-imports.mjs +439 -0
  4. package/dist/{adapter-core-CnrOXh1T.d.mts → adapter-core-BWM7cWOp.d.mts} +465 -401
  5. package/dist/{adapter-core-CtmnMMJ7.mjs → adapter-core-Bt4M5I2g.mjs} +21 -11
  6. package/dist/auth-interface-Clz-oWq1.d.mts +8 -0
  7. package/dist/better-auth-helpers-Bkezghej.mjs +541 -0
  8. package/dist/{better-auth-react-adapter-DNi5PC5D.d.mts → better-auth-react-adapter-BDxJ65mF.d.mts} +389 -302
  9. package/dist/{better-auth-react-adapter-Dv-o6A6O.mjs → better-auth-react-adapter-aMv8WeDb.mjs} +1 -1
  10. package/dist/{index-CzsGMS7C.d.mts → index-DHryUj7e.d.mts} +0 -1
  11. package/dist/index.d.mts +94 -5
  12. package/dist/index.mjs +4 -3
  13. package/dist/{neon-auth-Cs2cWh1B.mjs → neon-auth-CS4FpK2X.mjs} +1 -1
  14. package/dist/next/index.d.mts +161 -73
  15. package/dist/next/index.mjs +5 -4
  16. package/dist/next/server/index.d.mts +25 -5
  17. package/dist/next/server/index.mjs +369 -251
  18. package/dist/react/adapters/index.d.mts +3 -3
  19. package/dist/react/adapters/index.mjs +2 -2
  20. package/dist/react/index.d.mts +6 -5
  21. package/dist/react/index.mjs +5 -5
  22. package/dist/react/ui/index.d.mts +1 -2
  23. package/dist/react/ui/index.mjs +2 -4
  24. package/dist/react/ui/server.mjs +2 -2
  25. package/dist/{supabase-adapter-DUqw2fw8.d.mts → supabase-adapter-BGwV0Vu2.d.mts} +429 -373
  26. package/dist/{supabase-adapter-BlcGPyOf.mjs → supabase-adapter-DBt4LJJd.mjs} +3 -514
  27. package/dist/types/index.d.mts +2 -2
  28. package/dist/ui/.safelist.html +1 -1
  29. package/dist/ui/css.css +2 -2
  30. package/dist/ui/theme.css +1 -1
  31. package/dist/ui-CnVnqGns.mjs +3 -0
  32. package/dist/vanilla/adapters/index.d.mts +4 -3
  33. package/dist/vanilla/adapters/index.mjs +2 -2
  34. package/dist/vanilla/index.d.mts +4 -3
  35. package/dist/vanilla/index.mjs +2 -2
  36. package/llms.txt +2 -2
  37. package/package.json +27 -21
  38. package/dist/chunk-VCZJYX65-CLnrj1o7-D6ZQkcc_.mjs +0 -543
  39. package/dist/constants-Cupc_bln.mjs +0 -28
  40. package/dist/neon-auth-BEGCfAe6.d.mts +0 -107
  41. package/dist/ui-COLWzDsu.mjs +0 -12469
  42. /package/dist/{adapters-B7YKkjaL.mjs → adapters-CUvhsAvY.mjs} +0 -0
  43. /package/dist/{index-CPnFzULh.d.mts → index-B0Pd4HOH.d.mts} +0 -0
  44. /package/dist/{index-OEBbnNdr.d.mts → index-CzpoWrv9.d.mts} +0 -0
@@ -1,13 +1,13 @@
1
- import "../../adapter-core-CnrOXh1T.mjs";
2
- import "../../better-auth-react-adapter-DNi5PC5D.mjs";
3
- import "../../supabase-adapter-DUqw2fw8.mjs";
4
- import { o as VanillaBetterAuthClient } from "../../neon-auth-BEGCfAe6.mjs";
1
+ import { k as VanillaBetterAuthClient } from "../../adapter-core-BWM7cWOp.mjs";
2
+ import { a as isAuthError, i as isAuthApiError, n as AuthError, t as AuthApiError } from "../../auth-interface-Clz-oWq1.mjs";
5
3
  import { NextRequest, NextResponse } from "next/server";
6
4
 
7
5
  //#region src/server/config.d.ts
8
6
  /**
9
7
  * Framework-agnostic configuration types for Neon Auth
10
8
  */
9
+ /** Allowed values for the `SameSite` attribute on Neon Auth cookies. */
10
+ type SessionCookieSameSite = 'strict' | 'lax' | 'none';
11
11
  /**
12
12
  * Session cookie configuration
13
13
  */
@@ -43,6 +43,16 @@ interface SessionCookieConfig {
43
43
  * @example '.example.com' // Share across subdomains
44
44
  */
45
45
  domain?: string;
46
+ /**
47
+ * `SameSite` for cookies set or rewritten by the server proxy (API route, middleware, RSC).
48
+ *
49
+ * - **`strict` (default)** — cookies are not sent on cross-site requests (strongest default).
50
+ * - **`lax`** — previous hard-coded behavior; cookies sent on top-level cross-site navigations.
51
+ * - **`none`** — use for third-party contexts (for example your app embedded in another site’s iframe); requires `Secure` (always applied for these cookies).
52
+ *
53
+ * @default 'strict'
54
+ */
55
+ sameSite?: SessionCookieSameSite;
46
56
  }
47
57
  /**
48
58
  * Base configuration for Neon Auth server utilities
@@ -200,6 +210,10 @@ declare const API_ENDPOINTS: {
200
210
  readonly path: "sign-in/email-otp";
201
211
  readonly method: "POST";
202
212
  };
213
+ readonly magicLink: {
214
+ readonly path: "sign-in/magic-link";
215
+ readonly method: "POST";
216
+ };
203
217
  };
204
218
  readonly signUp: {
205
219
  readonly email: {
@@ -421,6 +435,12 @@ declare const API_ENDPOINTS: {
421
435
  readonly method: "POST";
422
436
  };
423
437
  };
438
+ readonly magicLink: {
439
+ readonly verify: {
440
+ readonly path: "magic-link/verify";
441
+ readonly method: "GET";
442
+ };
443
+ };
424
444
  };
425
445
  //#endregion
426
446
  //#region src/server/types.d.ts
@@ -535,4 +555,4 @@ type NeonAuth = NeonAuthServer & {
535
555
  middleware: (middlewareConfig?: Pick<NeonAuthMiddlewareConfig, 'loginUrl'>) => ReturnType<typeof neonAuthMiddleware>;
536
556
  };
537
557
  //#endregion
538
- export { NeonAuth, createNeonAuth };
558
+ export { AuthApiError, AuthError, NeonAuth, createNeonAuth, isAuthApiError, isAuthError };