@neondatabase/auth 0.1.0-beta.15 → 0.1.0-beta.16
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.
- package/README.md +1 -0
- package/dist/{adapter-core-ChIlSbGg.mjs → adapter-core-BQ6ga1zK.mjs} +2 -28
- package/dist/{adapter-core-CtcS7ex8.d.mts → adapter-core-DYWYECKK.d.mts} +112 -112
- package/dist/{better-auth-react-adapter-C3_WRaIy.mjs → better-auth-react-adapter-BLKXYcWM.mjs} +1 -1
- package/dist/{supabase-adapter-Bbn88gZj.d.mts → better-auth-react-adapter-tKs79AwE.d.mts} +303 -389
- package/dist/constants-2bpp2_-f.mjs +30 -0
- package/dist/index-B6dAIdkW.d.mts +100 -0
- package/dist/index.d.mts +5 -105
- package/dist/index.mjs +2 -2
- package/dist/middleware-DXwLKcbA.mjs +305 -0
- package/dist/neon-auth-B_otuPjh.d.mts +105 -0
- package/dist/{neon-auth-sSiNq4zM.mjs → neon-auth-ClDZNB9a.mjs} +1 -1
- package/dist/next/index.d.mts +2 -98
- package/dist/next/index.mjs +4 -309
- package/dist/next/server/index.d.mts +340 -0
- package/dist/next/server/index.mjs +432 -0
- package/dist/react/adapters/index.d.mts +4 -4
- package/dist/react/adapters/index.mjs +2 -2
- package/dist/react/index.d.mts +5 -5
- package/dist/react/index.mjs +4 -5
- package/dist/react/ui/index.d.mts +1 -1
- package/dist/react/ui/index.mjs +2 -3
- package/dist/react/ui/server.mjs +2 -2
- package/dist/{supabase-adapter-DhlcXYb9.mjs → supabase-adapter-Bl576usk.mjs} +2 -1
- package/dist/{better-auth-react-adapter-AucJqubr.d.mts → supabase-adapter-DtT0d6It.d.mts} +141 -55
- package/dist/types/index.d.mts +2 -2
- package/dist/ui/css.css +1 -1
- package/dist/ui/theme.css +1 -1
- package/dist/ui-DLtIc4wi.mjs +4 -0
- package/dist/vanilla/adapters/index.d.mts +4 -4
- package/dist/vanilla/adapters/index.mjs +2 -2
- package/dist/vanilla/index.d.mts +4 -4
- package/dist/vanilla/index.mjs +2 -2
- package/package.json +5 -1
- package/dist/chunk-5DLVHPZS-Bxj7snpZ-EhdAQJMu.mjs +0 -533
- package/dist/ui-C1IRQzLY.mjs +0 -9449
- /package/dist/{adapters-D0mxG3F-.mjs → adapters-CUvhsAvY.mjs} +0 -0
- /package/dist/{adapters-Df6Dd3KK.mjs → adapters-CivF9wql.mjs} +0 -0
- /package/dist/{better-auth-types-VqadyqlG.d.mts → better-auth-types-Kq3kGuiz.d.mts} +0 -0
- /package/dist/{index-ClXLQ1fw.d.mts → index-D8dPsry7.d.mts} +0 -0
- /package/dist/{index-BXlAjlSt.d.mts → index-D_HDtZfY.d.mts} +0 -0
- /package/dist/{index-DCQ5Y2ED.d.mts → index-OEBbnNdr.d.mts} +0 -0
package/README.md
CHANGED
|
@@ -242,6 +242,7 @@ For Next.js projects, this package provides built-in integration via `@neondatab
|
|
|
242
242
|
- Importing styles (with or without Tailwind CSS)
|
|
243
243
|
- Accessing session data with `neonAuth()` in server components
|
|
244
244
|
- Using `authClient.useSession()` hook in client components
|
|
245
|
+
- Server-side auth operations with `createAuthServer()` from `@neondatabase/auth/next/server`
|
|
245
246
|
|
|
246
247
|
## CSS for UI Components
|
|
247
248
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { a as NEON_AUTH_POPUP_CALLBACK_ROUTE, c as OAUTH_POPUP_MESSAGE_TYPE, i as NEON_AUTH_POPUP_CALLBACK_PARAM_NAME, l as SESSION_CACHE_TTL_MS, o as NEON_AUTH_POPUP_PARAM_NAME, s as NEON_AUTH_SESSION_VERIFIER_PARAM_NAME, t as CLOCK_SKEW_BUFFER_MS } from "./constants-2bpp2_-f.mjs";
|
|
1
2
|
import { getGlobalBroadcastChannel } from "better-auth/client";
|
|
2
3
|
import { adminClient, emailOTPClient, jwtClient, organizationClient } from "better-auth/client/plugins";
|
|
3
4
|
import z from "zod";
|
|
@@ -100,33 +101,6 @@ var InFlightRequestManager = class {
|
|
|
100
101
|
}
|
|
101
102
|
};
|
|
102
103
|
|
|
103
|
-
//#endregion
|
|
104
|
-
//#region src/core/constants.ts
|
|
105
|
-
/**
|
|
106
|
-
* Session caching configuration constants
|
|
107
|
-
*
|
|
108
|
-
* Uses industry-standard 60s cache TTL (common across auth providers).
|
|
109
|
-
*
|
|
110
|
-
* Note: Token refresh detection is now automatic via Better Auth's
|
|
111
|
-
* fetchOptions.onSuccess callback. No polling is needed.
|
|
112
|
-
*/
|
|
113
|
-
/** Session cache TTL in milliseconds (60 seconds) */
|
|
114
|
-
const SESSION_CACHE_TTL_MS = 6e4;
|
|
115
|
-
/** Clock skew buffer for token expiration checks in milliseconds (10 seconds) */
|
|
116
|
-
const CLOCK_SKEW_BUFFER_MS = 1e4;
|
|
117
|
-
/** Default session expiry duration in milliseconds (1 hour) */
|
|
118
|
-
const DEFAULT_SESSION_EXPIRY_MS = 36e5;
|
|
119
|
-
/** Name of the session verifier parameter in the URL, used for the OAUTH flow */
|
|
120
|
-
const NEON_AUTH_SESSION_VERIFIER_PARAM_NAME = "neon_auth_session_verifier";
|
|
121
|
-
/** Name of the popup marker parameter in the URL, used for OAuth popup flow in iframes */
|
|
122
|
-
const NEON_AUTH_POPUP_PARAM_NAME = "neon_popup";
|
|
123
|
-
/** Name of the original callback URL parameter, used in OAuth popup flow */
|
|
124
|
-
const NEON_AUTH_POPUP_CALLBACK_PARAM_NAME = "neon_popup_callback";
|
|
125
|
-
/** The callback route used for OAuth popup completion (must be in middleware SKIP_ROUTES) */
|
|
126
|
-
const NEON_AUTH_POPUP_CALLBACK_ROUTE = "/auth/callback";
|
|
127
|
-
/** Message type for OAuth popup completion postMessage */
|
|
128
|
-
const OAUTH_POPUP_MESSAGE_TYPE = "neon-auth:oauth-complete";
|
|
129
|
-
|
|
130
104
|
//#endregion
|
|
131
105
|
//#region src/utils/jwt.ts
|
|
132
106
|
/**
|
|
@@ -740,4 +714,4 @@ var NeonAuthAdapterCore = class {
|
|
|
740
714
|
};
|
|
741
715
|
|
|
742
716
|
//#endregion
|
|
743
|
-
export {
|
|
717
|
+
export { CURRENT_TAB_CLIENT_ID as i, BETTER_AUTH_METHODS_CACHE as n, BETTER_AUTH_METHODS_HOOKS as r, NeonAuthAdapterCore as t };
|