@neondatabase/auth 0.1.0-beta.13 → 0.1.0-beta.14
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/dist/{adapter-core-D1HVvYeG.d.mts → adapter-core-9F3bfyWA.d.mts} +66 -144
- package/dist/{adapter-core-Ed-EN_tr.mjs → adapter-core-BPv4mLT0.mjs} +1 -2
- package/dist/{better-auth-react-adapter-C4kQ31os.d.mts → better-auth-react-adapter-BYvAsZdj.d.mts} +228 -254
- package/dist/{better-auth-react-adapter-COSlFmvp.mjs → better-auth-react-adapter-BkeuhSFt.mjs} +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/{neon-auth-BHWfv-bR.mjs → neon-auth-BhLZg9v8.mjs} +1 -1
- package/dist/next/index.d.mts +2 -28
- package/dist/next/index.mjs +8 -8
- package/dist/react/adapters/index.d.mts +2 -2
- package/dist/react/adapters/index.mjs +1 -1
- package/dist/react/index.d.mts +2 -2
- package/dist/react/index.mjs +1 -1
- package/dist/{supabase-adapter-BFja3Oys.d.mts → supabase-adapter-_2wgvfZ3.d.mts} +227 -253
- package/dist/{supabase-adapter-NVDAeWHu.mjs → supabase-adapter-rl2coLdb.mjs} +9 -31
- package/dist/ui/.safelist.html +1 -1
- package/dist/ui/css.css +1 -1
- package/dist/ui/tailwind.css +1 -0
- package/dist/ui/theme-inline.css +39 -0
- package/dist/vanilla/adapters/index.d.mts +2 -2
- package/dist/vanilla/adapters/index.mjs +1 -1
- package/dist/vanilla/index.d.mts +2 -2
- package/dist/vanilla/index.mjs +1 -1
- package/package.json +2 -2
package/dist/{better-auth-react-adapter-COSlFmvp.mjs → better-auth-react-adapter-BkeuhSFt.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as NeonAuthAdapterCore } from "./adapter-core-
|
|
1
|
+
import { t as NeonAuthAdapterCore } from "./adapter-core-BPv4mLT0.mjs";
|
|
2
2
|
import { createAuthClient } from "better-auth/react";
|
|
3
3
|
|
|
4
4
|
//#region src/adapters/better-auth-react/better-auth-react-adapter.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as SupportedBetterAuthClientPlugins } from "./adapter-core-
|
|
2
|
-
import { r as BetterAuthReactAdapterInstance } from "./better-auth-react-adapter-
|
|
3
|
-
import { r as SupabaseAuthAdapterInstance, s as BetterAuthVanillaAdapterInstance } from "./supabase-adapter-
|
|
1
|
+
import { r as SupportedBetterAuthClientPlugins } from "./adapter-core-9F3bfyWA.mjs";
|
|
2
|
+
import { r as BetterAuthReactAdapterInstance } from "./better-auth-react-adapter-BYvAsZdj.mjs";
|
|
3
|
+
import { r as SupabaseAuthAdapterInstance, s as BetterAuthVanillaAdapterInstance } from "./supabase-adapter-_2wgvfZ3.mjs";
|
|
4
4
|
import { createAuthClient as createAuthClient$1 } from "better-auth/react";
|
|
5
5
|
import { createAuthClient as createAuthClient$2 } from "better-auth/client";
|
|
6
6
|
|
package/dist/index.mjs
CHANGED
package/dist/next/index.d.mts
CHANGED
|
@@ -1313,26 +1313,6 @@ declare function createAuthClient(): {
|
|
|
1313
1313
|
message?: string | undefined;
|
|
1314
1314
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
1315
1315
|
};
|
|
1316
|
-
} & {
|
|
1317
|
-
signIn: {
|
|
1318
|
-
anonymous: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
|
|
1319
|
-
query?: Record<string, any> | undefined;
|
|
1320
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1321
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
|
|
1322
|
-
token: string;
|
|
1323
|
-
user: {
|
|
1324
|
-
id: string;
|
|
1325
|
-
email: string;
|
|
1326
|
-
emailVerified: boolean;
|
|
1327
|
-
name: string;
|
|
1328
|
-
createdAt: Date;
|
|
1329
|
-
updatedAt: Date;
|
|
1330
|
-
};
|
|
1331
|
-
}, {
|
|
1332
|
-
code?: string | undefined;
|
|
1333
|
-
message?: string | undefined;
|
|
1334
|
-
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
1335
|
-
};
|
|
1336
1316
|
} & {
|
|
1337
1317
|
signIn: {
|
|
1338
1318
|
social: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
|
|
@@ -1418,7 +1398,7 @@ declare function createAuthClient(): {
|
|
|
1418
1398
|
image?: string | undefined;
|
|
1419
1399
|
callbackURL?: string | undefined;
|
|
1420
1400
|
fetchOptions?: FetchOptions | undefined;
|
|
1421
|
-
} & {} & {}
|
|
1401
|
+
} & {} & {}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<NonNullable<{
|
|
1422
1402
|
token: null;
|
|
1423
1403
|
user: {
|
|
1424
1404
|
id: string;
|
|
@@ -1574,7 +1554,7 @@ declare function createAuthClient(): {
|
|
|
1574
1554
|
image?: (string | null) | undefined;
|
|
1575
1555
|
name?: string | undefined;
|
|
1576
1556
|
fetchOptions?: FetchOptions | undefined;
|
|
1577
|
-
} & Partial<{} & {}
|
|
1557
|
+
} & Partial<{} & {}>> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
|
|
1578
1558
|
status: boolean;
|
|
1579
1559
|
}, {
|
|
1580
1560
|
code?: string | undefined;
|
|
@@ -1852,7 +1832,6 @@ declare function createAuthClient(): {
|
|
|
1852
1832
|
role?: string | null | undefined;
|
|
1853
1833
|
banReason?: string | null | undefined;
|
|
1854
1834
|
banExpires?: Date | null | undefined;
|
|
1855
|
-
isAnonymous: boolean | null | undefined;
|
|
1856
1835
|
};
|
|
1857
1836
|
session: {
|
|
1858
1837
|
id: string;
|
|
@@ -2026,7 +2005,6 @@ declare function createAuthClient(): {
|
|
|
2026
2005
|
role?: string | null | undefined;
|
|
2027
2006
|
banReason?: string | null | undefined;
|
|
2028
2007
|
banExpires?: Date | null | undefined;
|
|
2029
|
-
isAnonymous: boolean | null | undefined;
|
|
2030
2008
|
};
|
|
2031
2009
|
session: {
|
|
2032
2010
|
id: string;
|
|
@@ -2062,7 +2040,6 @@ declare function createAuthClient(): {
|
|
|
2062
2040
|
role?: string | null | undefined;
|
|
2063
2041
|
banReason?: string | null | undefined;
|
|
2064
2042
|
banExpires?: Date | null | undefined;
|
|
2065
|
-
isAnonymous: boolean | null | undefined;
|
|
2066
2043
|
};
|
|
2067
2044
|
session: {
|
|
2068
2045
|
id: string;
|
|
@@ -2229,9 +2206,6 @@ declare function createAuthClient(): {
|
|
|
2229
2206
|
readonly OTP_EXPIRED: "OTP expired";
|
|
2230
2207
|
readonly INVALID_OTP: "Invalid OTP";
|
|
2231
2208
|
readonly TOO_MANY_ATTEMPTS: "Too many attempts";
|
|
2232
|
-
readonly INVALID_EMAIL_FORMAT: "Email was not generated in a valid format";
|
|
2233
|
-
readonly COULD_NOT_CREATE_SESSION: "Could not create session";
|
|
2234
|
-
readonly ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY: "Anonymous users cannot sign in again anonymously";
|
|
2235
2209
|
readonly USER_NOT_FOUND: "User not found";
|
|
2236
2210
|
readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
|
|
2237
2211
|
readonly FAILED_TO_UPDATE_USER: "Failed to update user";
|
package/dist/next/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as BetterAuthReactAdapter } from "../better-auth-react-adapter-
|
|
2
|
-
import { t as createAuthClient$1 } from "../neon-auth-
|
|
1
|
+
import { t as BetterAuthReactAdapter } from "../better-auth-react-adapter-BkeuhSFt.mjs";
|
|
2
|
+
import { t as createAuthClient$1 } from "../neon-auth-BhLZg9v8.mjs";
|
|
3
3
|
import { parseCookies, parseSetCookieHeader } from "better-auth/cookies";
|
|
4
4
|
import { NextRequest, NextResponse } from "next/server";
|
|
5
5
|
import { cookies, headers } from "next/headers";
|
|
@@ -219,14 +219,14 @@ const NEON_AUTH_BASE_URL = process.env.NEON_AUTH_BASE_URL;
|
|
|
219
219
|
//#endregion
|
|
220
220
|
//#region src/next/auth/session.ts
|
|
221
221
|
/**
|
|
222
|
-
* A utility function to be used in react server components fetch the session details from the Neon Auth API, if session token is available in cookie.
|
|
223
|
-
*
|
|
222
|
+
* A utility function to be used in react server components fetch the session details from the Neon Auth API, if session token is available in cookie.
|
|
223
|
+
*
|
|
224
224
|
* @returns - `{ session: Session, user: User }` | `{ session: null, user: null}`.
|
|
225
|
-
*
|
|
225
|
+
*
|
|
226
226
|
* @example
|
|
227
227
|
* ```ts
|
|
228
228
|
* import { neonAuth } from "@neondatabase/auth/next"
|
|
229
|
-
*
|
|
229
|
+
*
|
|
230
230
|
* const { session, user } = await neonAuth()
|
|
231
231
|
* ```
|
|
232
232
|
*/
|
|
@@ -234,8 +234,8 @@ const neonAuth = async () => {
|
|
|
234
234
|
return await fetchSession();
|
|
235
235
|
};
|
|
236
236
|
/**
|
|
237
|
-
* A utility function to fetch the session details from the Neon Auth API, if session token is available in cookie.
|
|
238
|
-
*
|
|
237
|
+
* A utility function to fetch the session details from the Neon Auth API, if session token is available in cookie.
|
|
238
|
+
*
|
|
239
239
|
* @returns - `{ session: Session, user: User }` | `{ session: null, user: null}`.
|
|
240
240
|
*/
|
|
241
241
|
const fetchSession = async () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../adapter-core-
|
|
2
|
-
import { i as BetterAuthReactAdapterOptions, n as BetterAuthReactAdapterBuilder, r as BetterAuthReactAdapterInstance, t as BetterAuthReactAdapter } from "../../better-auth-react-adapter-
|
|
1
|
+
import "../../adapter-core-9F3bfyWA.mjs";
|
|
2
|
+
import { i as BetterAuthReactAdapterOptions, n as BetterAuthReactAdapterBuilder, r as BetterAuthReactAdapterInstance, t as BetterAuthReactAdapter } from "../../better-auth-react-adapter-BYvAsZdj.mjs";
|
|
3
3
|
import "../../index-DCQ5Y2ED.mjs";
|
|
4
4
|
export { BetterAuthReactAdapter, BetterAuthReactAdapterBuilder, BetterAuthReactAdapterInstance, BetterAuthReactAdapterOptions };
|
package/dist/react/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../adapter-core-
|
|
2
|
-
import { i as BetterAuthReactAdapterOptions, n as BetterAuthReactAdapterBuilder, r as BetterAuthReactAdapterInstance, t as BetterAuthReactAdapter } from "../better-auth-react-adapter-
|
|
1
|
+
import "../adapter-core-9F3bfyWA.mjs";
|
|
2
|
+
import { i as BetterAuthReactAdapterOptions, n as BetterAuthReactAdapterBuilder, r as BetterAuthReactAdapterInstance, t as BetterAuthReactAdapter } from "../better-auth-react-adapter-BYvAsZdj.mjs";
|
|
3
3
|
import "../index-DCQ5Y2ED.mjs";
|
|
4
4
|
import { $ as MagicLinkFormProps, $t as SignUpFormProps, A as ChangePasswordCard, An as UserViewClassNames, At as PasswordInput, B as DropboxIcon, Bn as socialProviders, Bt as ResetPasswordFormProps, C as AuthUIProviderProps, Cn as UserAvatarClassNames, Ct as OrganizationViewPageProps, D as AuthViewPaths, Dn as UserButtonProps, Dt as OrganizationsCard, E as AuthViewPath, En as UserButtonClassNames, Et as OrganizationViewProps, F as CreateTeamDialogProps, Fn as accountViewPaths, Ft as RecoverAccountFormProps, G as GitLabIcon, Gt as SettingsCard, H as ForgotPasswordForm, Hn as useAuthenticate, Ht as SecuritySettingsCards, I as DeleteAccountCard, In as authLocalization, It as RedditIcon, J as InputFieldSkeleton, Jt as SettingsCellSkeleton, K as GoogleIcon, Kt as SettingsCardClassNames, L as DeleteAccountCardProps, Ln as authViewPaths, Lt as RedirectToSignIn, M as CreateOrganizationDialog, Mn as VKIcon, Mt as ProvidersCard, N as CreateOrganizationDialogProps, Nn as XIcon, Nt as ProvidersCardProps, O as AuthViewProps, On as UserInvitationsCard, Ot as PasskeysCard, P as CreateTeamDialog, Pn as ZoomIcon, Pt as RecoverAccountForm, Q as MagicLinkForm, Qt as SignUpForm, R as DeleteOrganizationCard, Rn as getViewByPath, Rt as RedirectToSignUp, S as AuthUIProvider, Sn as UserAvatar, St as OrganizationViewClassNames, T as AuthViewClassNames, Tn as UserButton, Tt as OrganizationViewPaths, U as ForgotPasswordFormProps, Un as useCurrentOrganization, Ut as SessionsCard, V as FacebookIcon, Vn as useAuthData, Vt as RobloxIcon, W as GitHubIcon, Wn as useTheme, Wt as SessionsCardProps, X as LinearIcon, Xt as SignInFormProps, Y as KickIcon, Yt as SignInForm, Z as LinkedInIcon, Zt as SignOut, _ as AuthLoading, _n as UpdateAvatarCardProps, _t as OrganizationSlugCardProps, a as AccountViewPath, an as TeamCell, at as OrganizationInvitationsCard, b as AuthUIContext, bn as UpdateNameCard, bt as OrganizationSwitcherProps, c as AccountsCard, cn as TeamOptionsContext, ct as OrganizationLogoCardProps, d as AppleIcon, dn as TwitchIcon, dt as OrganizationMembersCard, en as SignedIn, et as MicrosoftIcon, f as AuthCallback, fn as TwoFactorCard, ft as OrganizationNameCard, g as AuthHooks, gn as UpdateAvatarCard, gt as OrganizationSlugCard, h as AuthFormProps, hn as TwoFactorFormProps, ht as OrganizationSettingsCardsProps, i as AccountView, in as Team, it as OrganizationCellView, j as ChangePasswordCardProps, jn as UserViewProps, jt as Provider, k as ChangeEmailCard, kn as UserView, kt as PasskeysCardProps, l as AccountsCardProps, ln as TeamsCard, lt as OrganizationLogoClassNames, m as AuthFormClassNames, mn as TwoFactorForm, mt as OrganizationSettingsCards, n as AcceptInvitationCardProps, nn as SlackIcon, nt as NeonAuthUIProviderProps, o as AccountViewPaths, on as TeamCellProps, ot as OrganizationLogo, p as AuthForm, pn as TwoFactorCardProps, pt as OrganizationNameCardProps, q as HuggingFaceIcon, qt as SettingsCardProps, r as AccountSettingsCards, rn as SpotifyIcon, rt as NotionIcon, s as AccountViewProps, sn as TeamOptions, st as OrganizationLogoCard, t as AcceptInvitationCard, tn as SignedOut, tt as NeonAuthUIProvider, u as ApiKeysCardProps, un as TikTokIcon, ut as OrganizationLogoProps, v as AuthLocalization, vn as UpdateFieldCard, vt as OrganizationSwitcher, w as AuthView, wn as UserAvatarProps, wt as OrganizationViewPath, x as AuthUIContextType, xn as UpdateUsernameCard, xt as OrganizationView, y as AuthMutators, yn as UpdateFieldCardProps, yt as OrganizationSwitcherClassNames, z as DiscordIcon, zn as organizationViewPaths, zt as ResetPasswordForm } from "../index-BXlAjlSt.mjs";
|
|
5
5
|
export { AcceptInvitationCard, AcceptInvitationCardProps, AccountSettingsCards, AccountView, AccountViewPath, AccountViewPaths, AccountViewProps, AccountsCard, AccountsCardProps, ApiKeysCardProps, AppleIcon, AuthCallback, AuthForm, AuthFormClassNames, AuthFormProps, AuthHooks, AuthLoading, AuthLocalization, AuthMutators, AuthUIContext, AuthUIContextType, AuthUIProvider, AuthUIProviderProps, AuthView, AuthViewClassNames, AuthViewPath, AuthViewPaths, AuthViewProps, BetterAuthReactAdapter, BetterAuthReactAdapterBuilder, BetterAuthReactAdapterInstance, BetterAuthReactAdapterOptions, ChangeEmailCard, ChangePasswordCard, ChangePasswordCardProps, CreateOrganizationDialog, CreateOrganizationDialogProps, CreateTeamDialog, CreateTeamDialogProps, DeleteAccountCard, DeleteAccountCardProps, DeleteOrganizationCard, DiscordIcon, DropboxIcon, FacebookIcon, ForgotPasswordForm, ForgotPasswordFormProps, GitHubIcon, GitLabIcon, GoogleIcon, HuggingFaceIcon, InputFieldSkeleton, KickIcon, LinearIcon, LinkedInIcon, MagicLinkForm, MagicLinkFormProps, MicrosoftIcon, NeonAuthUIProvider, NeonAuthUIProviderProps, NotionIcon, OrganizationCellView, OrganizationInvitationsCard, OrganizationLogo, OrganizationLogoCard, OrganizationLogoCardProps, OrganizationLogoClassNames, OrganizationLogoProps, OrganizationMembersCard, OrganizationNameCard, OrganizationNameCardProps, OrganizationSettingsCards, OrganizationSettingsCardsProps, OrganizationSlugCard, OrganizationSlugCardProps, OrganizationSwitcher, OrganizationSwitcherClassNames, OrganizationSwitcherProps, OrganizationView, OrganizationViewClassNames, OrganizationViewPageProps, OrganizationViewPath, OrganizationViewPaths, OrganizationViewProps, OrganizationsCard, PasskeysCard, PasskeysCardProps, PasswordInput, Provider, ProvidersCard, ProvidersCardProps, RecoverAccountForm, RecoverAccountFormProps, RedditIcon, RedirectToSignIn, RedirectToSignUp, ResetPasswordForm, ResetPasswordFormProps, RobloxIcon, SecuritySettingsCards, SessionsCard, SessionsCardProps, SettingsCard, SettingsCardClassNames, SettingsCardProps, SettingsCellSkeleton, SignInForm, SignInFormProps, SignOut, SignUpForm, SignUpFormProps, SignedIn, SignedOut, SlackIcon, SpotifyIcon, Team, TeamCell, TeamCellProps, TeamOptions, TeamOptionsContext, TeamsCard, TikTokIcon, TwitchIcon, TwoFactorCard, TwoFactorCardProps, TwoFactorForm, TwoFactorFormProps, UpdateAvatarCard, UpdateAvatarCardProps, UpdateFieldCard, UpdateFieldCardProps, UpdateNameCard, UpdateUsernameCard, UserAvatar, UserAvatarClassNames, UserAvatarProps, UserButton, UserButtonClassNames, UserButtonProps, UserInvitationsCard, UserView, UserViewClassNames, UserViewProps, VKIcon, XIcon, ZoomIcon, accountViewPaths, authLocalization, authViewPaths, getViewByPath, organizationViewPaths, socialProviders, useAuthData, useAuthenticate, useCurrentOrganization, useTheme };
|
package/dist/react/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BetterAuthReactAdapter } from "../better-auth-react-adapter-
|
|
1
|
+
import { t as BetterAuthReactAdapter } from "../better-auth-react-adapter-BkeuhSFt.mjs";
|
|
2
2
|
import { c as getViewByPath, n as authLocalization, r as authViewPaths, t as accountViewPaths, u as organizationViewPaths } from "../chunk-5DLVHPZS-Bxj7snpZ-EhdAQJMu.mjs";
|
|
3
3
|
import { $ as RobloxIcon, A as MagicLinkForm, At as useAuthenticate, B as OrganizationSettingsCards, C as GitLabIcon, Ct as UserInvitationsCard, D as KickIcon, Dt as ZoomIcon, E as InputFieldSkeleton, Et as XIcon3, F as OrganizationInvitationsCard, G as PasskeysCard, H as OrganizationSwitcher, I as OrganizationLogo, J as RecoverAccountForm, K as PasswordInput, L as OrganizationLogoCard, M as NeonAuthUIProvider, Mt as useTheme, N as NotionIcon, O as LinearIcon, Ot as socialProviders, P as OrganizationCellView, Q as ResetPasswordForm, R as OrganizationMembersCard, S as GitHubIcon, St as UserButton, T as HuggingFaceIcon, Tt as VKIcon, U as OrganizationView, V as OrganizationSlugCard, W as OrganizationsCard, X as RedirectToSignIn, Y as RedditIcon, Z as RedirectToSignUp, _ as DeleteOrganizationCard, _t as UpdateAvatarCard, a as AppleIcon, at as SignOut, b as FacebookIcon, bt as UpdateUsernameCard, c as AuthLoading, ct as SignedOut, d as AuthView, dt as TeamCell, et as SecuritySettingsCards, f as ChangeEmailCard, ft as TeamsCard, g as DeleteAccountCard, gt as TwoFactorForm, h as CreateTeamDialog, ht as TwoFactorCard, i as AccountsCard, it as SignInForm, j as MicrosoftIcon, jt as useCurrentOrganization, k as LinkedInIcon, kt as useAuthData, l as AuthUIContext, lt as SlackIcon, m as CreateOrganizationDialog, mt as TwitchIcon, n as AccountSettingsCards, nt as SettingsCard, o as AuthCallback, ot as SignUpForm, p as ChangePasswordCard, pt as TikTokIcon, q as ProvidersCard, r as AccountView, rt as SettingsCellSkeleton, s as AuthForm, st as SignedIn, t as AcceptInvitationCard, tt as SessionsCard, u as AuthUIProvider, ut as SpotifyIcon, v as DiscordIcon, vt as UpdateFieldCard, w as GoogleIcon, wt as UserView, x as ForgotPasswordForm, xt as UserAvatar, y as DropboxIcon, yt as UpdateNameCard, z as OrganizationNameCard } from "../ui-C1IRQzLY.mjs";
|
|
4
4
|
|