@neondatabase/auth 0.4.1-beta → 0.4.2-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.
@@ -1,4 +1,4 @@
1
- import { t as NeonAuthAdapterCore } from "./adapter-core-BFMM3lwe.mjs";
1
+ import { t as NeonAuthAdapterCore } from "./adapter-core-D4V1J06B.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 { S as ReactBetterAuthClient, k as VanillaBetterAuthClient } from "./adapter-core-ClY-p_AI.mjs";
2
- import { n as BetterAuthReactAdapterInstance } from "./better-auth-react-adapter-iJMZCLUI.mjs";
3
- import { r as SupabaseAuthAdapterInstance, s as BetterAuthVanillaAdapterInstance } from "./supabase-adapter-cuLnmLDs.mjs";
1
+ import { A as VanillaBetterAuthClient, C as ReactBetterAuthClient } from "./adapter-core-BiYHR4I-.mjs";
2
+ import { n as BetterAuthReactAdapterInstance } from "./better-auth-react-adapter-D53HN_n5.mjs";
3
+ import { r as SupabaseAuthAdapterInstance, s as BetterAuthVanillaAdapterInstance } from "./supabase-adapter-X2YsFZi4.mjs";
4
4
  import { a as isAuthError, i as isAuthApiError, n as AuthError, t as AuthApiError } from "./auth-interface-Clz-oWq1.mjs";
5
5
 
6
6
  //#region src/neon-auth.d.ts
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import "./adapter-core-BFMM3lwe.mjs";
1
+ import "./adapter-core-D4V1J06B.mjs";
2
2
  import { c as isAuthApiError, l as isAuthError, o as AuthApiError, s as AuthError } from "./better-auth-helpers-Bkezghej.mjs";
3
- import { n as createInternalNeonAuth, t as createAuthClient } from "./neon-auth-VDrC3GwX.mjs";
3
+ import { n as createInternalNeonAuth, t as createAuthClient } from "./neon-auth-BEYvHA5c.mjs";
4
4
 
5
5
  export { AuthApiError, AuthError, createAuthClient, createInternalNeonAuth, isAuthApiError, isAuthError };
@@ -1,4 +1,4 @@
1
- import { n as BetterAuthVanillaAdapter } from "./supabase-adapter-CAyBFrNn.mjs";
1
+ import { n as BetterAuthVanillaAdapter } from "./supabase-adapter-BbSvEBy0.mjs";
2
2
 
3
3
  //#region src/neon-auth.ts
4
4
  /**
@@ -1284,6 +1284,110 @@ declare function createAuthClient(): {
1284
1284
  message?: string | undefined;
1285
1285
  }, FetchOptions["throw"] extends true ? true : false>>;
1286
1286
  };
1287
+ } & {
1288
+ signIn: {
1289
+ phoneNumber: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1290
+ phoneNumber: string;
1291
+ password: string;
1292
+ rememberMe?: boolean | undefined;
1293
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1294
+ phoneNumber: string;
1295
+ password: string;
1296
+ rememberMe?: boolean | undefined;
1297
+ } & {
1298
+ fetchOptions?: FetchOptions | undefined;
1299
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1300
+ token: string;
1301
+ user: better_auth_plugins0.UserWithPhoneNumber;
1302
+ }, {
1303
+ code?: string | undefined;
1304
+ message?: string | undefined;
1305
+ }, FetchOptions["throw"] extends true ? true : false>>;
1306
+ };
1307
+ } & {
1308
+ phoneNumber: {
1309
+ sendOtp: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1310
+ phoneNumber: string;
1311
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1312
+ phoneNumber: string;
1313
+ } & {
1314
+ fetchOptions?: FetchOptions | undefined;
1315
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1316
+ message: string;
1317
+ }, {
1318
+ code?: string | undefined;
1319
+ message?: string | undefined;
1320
+ }, FetchOptions["throw"] extends true ? true : false>>;
1321
+ };
1322
+ } & {
1323
+ phoneNumber: {
1324
+ verify: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1325
+ phoneNumber: string;
1326
+ code: string;
1327
+ disableSession?: boolean | undefined;
1328
+ updatePhoneNumber?: boolean | undefined;
1329
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1330
+ phoneNumber: string;
1331
+ code: string;
1332
+ disableSession?: boolean | undefined;
1333
+ updatePhoneNumber?: boolean | undefined;
1334
+ } & {
1335
+ fetchOptions?: FetchOptions | undefined;
1336
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<NonNullable<{
1337
+ status: boolean;
1338
+ token: string;
1339
+ user: {
1340
+ id: string;
1341
+ createdAt: Date;
1342
+ updatedAt: Date;
1343
+ email: string;
1344
+ emailVerified: boolean;
1345
+ name: string;
1346
+ image?: string | null | undefined;
1347
+ } & better_auth_plugins0.UserWithPhoneNumber;
1348
+ } | {
1349
+ status: boolean;
1350
+ token: null;
1351
+ user: better_auth_plugins0.UserWithPhoneNumber;
1352
+ }>, {
1353
+ code?: string | undefined;
1354
+ message?: string | undefined;
1355
+ }, FetchOptions["throw"] extends true ? true : false>>;
1356
+ };
1357
+ } & {
1358
+ phoneNumber: {
1359
+ requestPasswordReset: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1360
+ phoneNumber: string;
1361
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1362
+ phoneNumber: string;
1363
+ } & {
1364
+ fetchOptions?: FetchOptions | undefined;
1365
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1366
+ status: boolean;
1367
+ }, {
1368
+ code?: string | undefined;
1369
+ message?: string | undefined;
1370
+ }, FetchOptions["throw"] extends true ? true : false>>;
1371
+ };
1372
+ } & {
1373
+ phoneNumber: {
1374
+ resetPassword: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1375
+ otp: string;
1376
+ phoneNumber: string;
1377
+ newPassword: string;
1378
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1379
+ otp: string;
1380
+ phoneNumber: string;
1381
+ newPassword: string;
1382
+ } & {
1383
+ fetchOptions?: FetchOptions | undefined;
1384
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1385
+ status: boolean;
1386
+ }, {
1387
+ code?: string | undefined;
1388
+ message?: string | undefined;
1389
+ }, FetchOptions["throw"] extends true ? true : false>>;
1390
+ };
1287
1391
  } & {
1288
1392
  signIn: {
1289
1393
  social: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
@@ -1369,7 +1473,9 @@ declare function createAuthClient(): {
1369
1473
  image?: string | undefined;
1370
1474
  callbackURL?: string | undefined;
1371
1475
  fetchOptions?: FetchOptions | undefined;
1372
- } & {} & {}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<NonNullable<{
1476
+ } & {} & {} & {} & {
1477
+ phoneNumber?: string | null | undefined;
1478
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<NonNullable<{
1373
1479
  token: null;
1374
1480
  user: {
1375
1481
  id: string;
@@ -1525,7 +1631,9 @@ declare function createAuthClient(): {
1525
1631
  image?: (string | null) | undefined;
1526
1632
  name?: string | undefined;
1527
1633
  fetchOptions?: FetchOptions | undefined;
1528
- } & Partial<{} & {}>> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1634
+ } & Partial<{} & {} & {} & {
1635
+ phoneNumber?: string | null | undefined;
1636
+ }>> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1529
1637
  status: boolean;
1530
1638
  }, {
1531
1639
  code?: string | undefined;
@@ -1803,6 +1911,8 @@ declare function createAuthClient(): {
1803
1911
  role?: string | null | undefined;
1804
1912
  banReason?: string | null | undefined;
1805
1913
  banExpires?: Date | null | undefined;
1914
+ phoneNumber?: string | null | undefined;
1915
+ phoneNumberVerified?: boolean | null | undefined;
1806
1916
  };
1807
1917
  session: {
1808
1918
  id: string;
@@ -1976,6 +2086,8 @@ declare function createAuthClient(): {
1976
2086
  role?: string | null | undefined;
1977
2087
  banReason?: string | null | undefined;
1978
2088
  banExpires?: Date | null | undefined;
2089
+ phoneNumber?: string | null | undefined;
2090
+ phoneNumberVerified?: boolean | null | undefined;
1979
2091
  };
1980
2092
  session: {
1981
2093
  id: string;
@@ -2011,6 +2123,8 @@ declare function createAuthClient(): {
2011
2123
  role?: string | null | undefined;
2012
2124
  banReason?: string | null | undefined;
2013
2125
  banExpires?: Date | null | undefined;
2126
+ phoneNumber?: string | null | undefined;
2127
+ phoneNumberVerified?: boolean | null | undefined;
2014
2128
  };
2015
2129
  session: {
2016
2130
  id: string;
@@ -2178,6 +2292,15 @@ declare function createAuthClient(): {
2178
2292
  readonly OTP_EXPIRED: "OTP expired";
2179
2293
  readonly INVALID_OTP: "Invalid OTP";
2180
2294
  readonly TOO_MANY_ATTEMPTS: "Too many attempts";
2295
+ readonly INVALID_PHONE_NUMBER: "Invalid phone number";
2296
+ readonly PHONE_NUMBER_EXIST: "Phone number already exists";
2297
+ readonly PHONE_NUMBER_NOT_EXIST: "phone number isn't registered";
2298
+ readonly INVALID_PHONE_NUMBER_OR_PASSWORD: "Invalid phone number or password";
2299
+ readonly UNEXPECTED_ERROR: "Unexpected error";
2300
+ readonly OTP_NOT_FOUND: "OTP not found";
2301
+ readonly PHONE_NUMBER_NOT_VERIFIED: "Phone number not verified";
2302
+ readonly PHONE_NUMBER_CANNOT_BE_UPDATED: "Phone number cannot be updated";
2303
+ readonly SEND_OTP_NOT_IMPLEMENTED: "sendOTP not implemented";
2181
2304
  readonly USER_NOT_FOUND: "User not found";
2182
2305
  readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
2183
2306
  readonly FAILED_TO_UPDATE_USER: "Failed to update user";
@@ -1,7 +1,7 @@
1
- import "../adapter-core-BFMM3lwe.mjs";
1
+ import "../adapter-core-D4V1J06B.mjs";
2
2
  import { c as isAuthApiError, l as isAuthError, o as AuthApiError, s as AuthError } from "../better-auth-helpers-Bkezghej.mjs";
3
- import { t as BetterAuthReactAdapter } from "../better-auth-react-adapter-DZTZVVnk.mjs";
4
- import { t as createAuthClient$1 } from "../neon-auth-VDrC3GwX.mjs";
3
+ import { t as BetterAuthReactAdapter } from "../better-auth-react-adapter-DswZ_kCQ.mjs";
4
+ import { t as createAuthClient$1 } from "../neon-auth-BEYvHA5c.mjs";
5
5
 
6
6
  //#region src/next/index.ts
7
7
  function createAuthClient() {
@@ -1,4 +1,4 @@
1
- import { k as VanillaBetterAuthClient } from "../../adapter-core-ClY-p_AI.mjs";
1
+ import { A as VanillaBetterAuthClient } from "../../adapter-core-BiYHR4I-.mjs";
2
2
  import { a as isAuthError, i as isAuthApiError, n as AuthError, t as AuthApiError } from "../../auth-interface-Clz-oWq1.mjs";
3
3
  import { NextRequest, NextResponse } from "next/server";
4
4
 
@@ -1,4 +1,4 @@
1
- import "../../adapter-core-ClY-p_AI.mjs";
2
- import { n as BetterAuthReactAdapterInstance, r as BetterAuthReactAdapterOptions, t as BetterAuthReactAdapter } from "../../better-auth-react-adapter-iJMZCLUI.mjs";
1
+ import "../../adapter-core-BiYHR4I-.mjs";
2
+ import { n as BetterAuthReactAdapterInstance, r as BetterAuthReactAdapterOptions, t as BetterAuthReactAdapter } from "../../better-auth-react-adapter-D53HN_n5.mjs";
3
3
  import "../../index-B0Pd4HOH.mjs";
4
4
  export { BetterAuthReactAdapter, BetterAuthReactAdapterInstance, BetterAuthReactAdapterOptions };
@@ -1,4 +1,4 @@
1
- import "../../adapter-core-BFMM3lwe.mjs";
2
- import { t as BetterAuthReactAdapter } from "../../better-auth-react-adapter-DZTZVVnk.mjs";
1
+ import "../../adapter-core-D4V1J06B.mjs";
2
+ import { t as BetterAuthReactAdapter } from "../../better-auth-react-adapter-DswZ_kCQ.mjs";
3
3
 
4
4
  export { BetterAuthReactAdapter };
@@ -1,5 +1,5 @@
1
- import "../adapter-core-ClY-p_AI.mjs";
2
- import { n as BetterAuthReactAdapterInstance, r as BetterAuthReactAdapterOptions, t as BetterAuthReactAdapter } from "../better-auth-react-adapter-iJMZCLUI.mjs";
1
+ import "../adapter-core-BiYHR4I-.mjs";
2
+ import { n as BetterAuthReactAdapterInstance, r as BetterAuthReactAdapterOptions, t as BetterAuthReactAdapter } from "../better-auth-react-adapter-D53HN_n5.mjs";
3
3
  import "../index-B0Pd4HOH.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-DHryUj7e.mjs";
5
5
  import { useStore } from "better-auth/react";
@@ -1,5 +1,5 @@
1
- import "../adapter-core-BFMM3lwe.mjs";
2
- import { t as BetterAuthReactAdapter } from "../better-auth-react-adapter-DZTZVVnk.mjs";
1
+ import "../adapter-core-D4V1J06B.mjs";
2
+ import { t as BetterAuthReactAdapter } from "../better-auth-react-adapter-DswZ_kCQ.mjs";
3
3
  import { $ as RobloxIcon, A as MagicLinkForm, At as authViewPaths, B as OrganizationSettingsCards, C as GitLabIcon, Ct as UserInvitationsCard, D as KickIcon, Dt as ZoomIcon, E as InputFieldSkeleton, Et as XIcon, F as OrganizationInvitationsCard, Ft as useAuthenticate, G as PasskeysCard, H as OrganizationSwitcher, I as OrganizationLogo, It as useCurrentOrganization, J as RecoverAccountForm, K as PasswordInput, L as OrganizationLogoCard, Lt as useTheme, M as NeonAuthUIProvider, Mt as organizationViewPaths, N as NotionIcon, Nt as socialProviders, O as LinearIcon, Ot as accountViewPaths, P as OrganizationCellView, Pt as useAuthData, 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 getViewByPath, k as LinkedInIcon, kt as authLocalization, 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-CnVnqGns.mjs";
4
4
  import { useStore } from "better-auth/react";
5
5
 
@@ -1,4 +1,4 @@
1
- import { i as CURRENT_TAB_CLIENT_ID, n as BETTER_AUTH_METHODS_CACHE, r as BETTER_AUTH_METHODS_HOOKS, t as NeonAuthAdapterCore } from "./adapter-core-BFMM3lwe.mjs";
1
+ import { i as CURRENT_TAB_CLIENT_ID, n as BETTER_AUTH_METHODS_CACHE, r as BETTER_AUTH_METHODS_HOOKS, t as NeonAuthAdapterCore } from "./adapter-core-D4V1J06B.mjs";
2
2
  import { a as createAuthError, i as AuthErrorCode, l as isAuthError, n as mapBetterAuthSession, r as normalizeBetterAuthError, t as mapBetterAuthIdentity } from "./better-auth-helpers-Bkezghej.mjs";
3
3
  import { createAuthClient, getGlobalBroadcastChannel } from "better-auth/client";
4
4
  import "@supabase/auth-js";