@neondatabase/auth 0.3.0-beta → 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.
- package/README.md +22 -7
- package/codemods/migrate-auth-ui-imports.mjs +439 -0
- package/dist/{adapter-core-B9uDhoYq.d.mts → adapter-core-BWM7cWOp.d.mts} +311 -176
- package/dist/{adapter-core-D00qcqMo.mjs → adapter-core-Bt4M5I2g.mjs} +21 -11
- package/dist/auth-interface-Clz-oWq1.d.mts +8 -0
- package/dist/better-auth-helpers-Bkezghej.mjs +541 -0
- package/dist/{better-auth-react-adapter-BO4jLN4H.d.mts → better-auth-react-adapter-BDxJ65mF.d.mts} +384 -297
- package/dist/{better-auth-react-adapter-Xdj-69i9.mjs → better-auth-react-adapter-aMv8WeDb.mjs} +1 -1
- package/dist/index.d.mts +5 -4
- package/dist/index.mjs +4 -3
- package/dist/{neon-auth-DBOB8sXF.mjs → neon-auth-CS4FpK2X.mjs} +1 -1
- package/dist/next/index.d.mts +144 -56
- package/dist/next/index.mjs +5 -4
- package/dist/next/server/index.d.mts +25 -3
- package/dist/next/server/index.mjs +60 -30
- package/dist/react/adapters/index.d.mts +3 -3
- package/dist/react/adapters/index.mjs +2 -2
- package/dist/react/index.d.mts +4 -4
- package/dist/react/index.mjs +2 -2
- package/dist/react/ui/index.d.mts +1 -1
- package/dist/{supabase-adapter-CSDRL1ZU.d.mts → supabase-adapter-BGwV0Vu2.d.mts} +381 -294
- package/dist/{supabase-adapter-CIBMebXB.mjs → supabase-adapter-DBt4LJJd.mjs} +3 -514
- package/dist/types/index.d.mts +2 -2
- package/dist/vanilla/adapters/index.d.mts +4 -3
- package/dist/vanilla/adapters/index.mjs +2 -2
- package/dist/vanilla/index.d.mts +4 -3
- package/dist/vanilla/index.mjs +2 -2
- package/llms.txt +2 -2
- package/package.json +6 -2
- package/dist/constants-Cupc_bln.mjs +0 -28
- /package/dist/{index-CPnFzULh.d.mts → index-B0Pd4HOH.d.mts} +0 -0
- /package/dist/{index-UW23fDSn.d.mts → index-CzpoWrv9.d.mts} +0 -0
- /package/dist/{index-B_Q0Tp1D.d.mts → index-DHryUj7e.d.mts} +0 -0
package/dist/{better-auth-react-adapter-Xdj-69i9.mjs → better-auth-react-adapter-aMv8WeDb.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as NeonAuthAdapterCore } from "./adapter-core-
|
|
1
|
+
import { t as NeonAuthAdapterCore } from "./adapter-core-Bt4M5I2g.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,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as BetterAuthReactAdapterInstance } from "./better-auth-react-adapter-
|
|
3
|
-
import { r as SupabaseAuthAdapterInstance, s as BetterAuthVanillaAdapterInstance } from "./supabase-adapter-
|
|
1
|
+
import { S as ReactBetterAuthClient, k as VanillaBetterAuthClient } from "./adapter-core-BWM7cWOp.mjs";
|
|
2
|
+
import { n as BetterAuthReactAdapterInstance } from "./better-auth-react-adapter-BDxJ65mF.mjs";
|
|
3
|
+
import { r as SupabaseAuthAdapterInstance, s as BetterAuthVanillaAdapterInstance } from "./supabase-adapter-BGwV0Vu2.mjs";
|
|
4
|
+
import { a as isAuthError, i as isAuthApiError, n as AuthError, t as AuthApiError } from "./auth-interface-Clz-oWq1.mjs";
|
|
4
5
|
|
|
5
6
|
//#region src/neon-auth.d.ts
|
|
6
7
|
|
|
@@ -90,4 +91,4 @@ type NeonAuth<T extends NeonAuthAdapter> = {
|
|
|
90
91
|
declare function createInternalNeonAuth<T extends NeonAuthAdapter = BetterAuthVanillaAdapterInstance>(url: string, config?: NeonAuthConfigInternal<T>): NeonAuth<T>;
|
|
91
92
|
declare function createAuthClient<T extends NeonAuthAdapter = BetterAuthVanillaAdapterInstance>(url: string, config?: NeonAuthConfig<T>): NeonAuthPublicApi<T>;
|
|
92
93
|
//#endregion
|
|
93
|
-
export { type NeonAuth, type NeonAuthAdapter, type NeonAuthConfig, type NeonAuthPublicApi, type ReactBetterAuthClient, type VanillaBetterAuthClient, createAuthClient, createInternalNeonAuth };
|
|
94
|
+
export { AuthApiError, AuthError, type NeonAuth, type NeonAuthAdapter, type NeonAuthConfig, type NeonAuthPublicApi, type ReactBetterAuthClient, type VanillaBetterAuthClient, createAuthClient, createInternalNeonAuth, isAuthApiError, isAuthError };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import "./adapter-core-
|
|
2
|
-
import {
|
|
1
|
+
import "./adapter-core-Bt4M5I2g.mjs";
|
|
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-CS4FpK2X.mjs";
|
|
3
4
|
|
|
4
|
-
export { createAuthClient, createInternalNeonAuth };
|
|
5
|
+
export { AuthApiError, AuthError, createAuthClient, createInternalNeonAuth, isAuthApiError, isAuthError };
|
package/dist/next/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { a as isAuthError, i as isAuthApiError, n as AuthError, t as AuthApiError } from "../auth-interface-Clz-oWq1.mjs";
|
|
1
2
|
import * as better_auth_react0 from "better-auth/react";
|
|
2
3
|
import * as jose0 from "jose";
|
|
3
4
|
import * as better_auth_plugins0 from "better-auth/plugins";
|
|
@@ -124,15 +125,7 @@ declare function createAuthClient(): {
|
|
|
124
125
|
id: string;
|
|
125
126
|
};
|
|
126
127
|
fetchOptions?: FetchOptions | undefined;
|
|
127
|
-
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
|
|
128
|
-
id: string;
|
|
129
|
-
createdAt: Date;
|
|
130
|
-
updatedAt: Date;
|
|
131
|
-
email: string;
|
|
132
|
-
emailVerified: boolean;
|
|
133
|
-
name: string;
|
|
134
|
-
image?: string | null | undefined;
|
|
135
|
-
}, {
|
|
128
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<better_auth_plugins0.UserWithRole, {
|
|
136
129
|
code?: string | undefined;
|
|
137
130
|
message?: string | undefined;
|
|
138
131
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
@@ -141,13 +134,13 @@ declare function createAuthClient(): {
|
|
|
141
134
|
admin: {
|
|
142
135
|
createUser: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
|
|
143
136
|
email: string;
|
|
144
|
-
password
|
|
137
|
+
password?: string | undefined;
|
|
145
138
|
name: string;
|
|
146
139
|
role?: "user" | "admin" | ("user" | "admin")[] | undefined;
|
|
147
140
|
data?: Record<string, any> | undefined;
|
|
148
141
|
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
|
|
149
142
|
email: string;
|
|
150
|
-
password
|
|
143
|
+
password?: string | undefined;
|
|
151
144
|
name: string;
|
|
152
145
|
role?: "user" | "admin" | ("user" | "admin")[] | undefined;
|
|
153
146
|
data?: Record<string, any> | undefined;
|
|
@@ -239,15 +232,7 @@ declare function createAuthClient(): {
|
|
|
239
232
|
} & {
|
|
240
233
|
fetchOptions?: FetchOptions | undefined;
|
|
241
234
|
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
|
|
242
|
-
user:
|
|
243
|
-
id: string;
|
|
244
|
-
createdAt: Date;
|
|
245
|
-
updatedAt: Date;
|
|
246
|
-
email: string;
|
|
247
|
-
emailVerified: boolean;
|
|
248
|
-
name: string;
|
|
249
|
-
image?: string | null | undefined;
|
|
250
|
-
} & Record<string, any>;
|
|
235
|
+
user: better_auth_plugins0.UserWithRole;
|
|
251
236
|
}, {
|
|
252
237
|
code?: string | undefined;
|
|
253
238
|
message?: string | undefined;
|
|
@@ -266,15 +251,7 @@ declare function createAuthClient(): {
|
|
|
266
251
|
} & {
|
|
267
252
|
fetchOptions?: FetchOptions | undefined;
|
|
268
253
|
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
|
|
269
|
-
user:
|
|
270
|
-
id: string;
|
|
271
|
-
createdAt: Date;
|
|
272
|
-
updatedAt: Date;
|
|
273
|
-
email: string;
|
|
274
|
-
emailVerified: boolean;
|
|
275
|
-
name: string;
|
|
276
|
-
image?: string | null | undefined;
|
|
277
|
-
} & Record<string, any>;
|
|
254
|
+
user: better_auth_plugins0.UserWithRole;
|
|
278
255
|
}, {
|
|
279
256
|
code?: string | undefined;
|
|
280
257
|
message?: string | undefined;
|
|
@@ -311,8 +288,25 @@ declare function createAuthClient(): {
|
|
|
311
288
|
query?: Record<string, any> | undefined;
|
|
312
289
|
fetchOptions?: FetchOptions | undefined;
|
|
313
290
|
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
|
|
314
|
-
session:
|
|
315
|
-
|
|
291
|
+
session: {
|
|
292
|
+
id: string;
|
|
293
|
+
createdAt: Date;
|
|
294
|
+
updatedAt: Date;
|
|
295
|
+
userId: string;
|
|
296
|
+
expiresAt: Date;
|
|
297
|
+
token: string;
|
|
298
|
+
ipAddress?: string | null | undefined;
|
|
299
|
+
userAgent?: string | null | undefined;
|
|
300
|
+
} & Record<string, any>;
|
|
301
|
+
user: {
|
|
302
|
+
id: string;
|
|
303
|
+
createdAt: Date;
|
|
304
|
+
updatedAt: Date;
|
|
305
|
+
email: string;
|
|
306
|
+
emailVerified: boolean;
|
|
307
|
+
name: string;
|
|
308
|
+
image?: string | null | undefined;
|
|
309
|
+
} & Record<string, any>;
|
|
316
310
|
}, {
|
|
317
311
|
code?: string | undefined;
|
|
318
312
|
message?: string | undefined;
|
|
@@ -488,8 +482,6 @@ declare function createAuthClient(): {
|
|
|
488
482
|
createdAt: Date;
|
|
489
483
|
logo?: string | null | undefined | undefined;
|
|
490
484
|
metadata?: any;
|
|
491
|
-
} & {
|
|
492
|
-
metadata: Record<string, any> | undefined;
|
|
493
485
|
}, {
|
|
494
486
|
code?: string | undefined;
|
|
495
487
|
message?: string | undefined;
|
|
@@ -641,7 +633,7 @@ declare function createAuthClient(): {
|
|
|
641
633
|
resend?: boolean | undefined;
|
|
642
634
|
} & {
|
|
643
635
|
fetchOptions?: FetchOptions | undefined;
|
|
644
|
-
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
|
|
636
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<NonNullable<{
|
|
645
637
|
id: string;
|
|
646
638
|
organizationId: string;
|
|
647
639
|
email: string;
|
|
@@ -650,7 +642,16 @@ declare function createAuthClient(): {
|
|
|
650
642
|
inviterId: string;
|
|
651
643
|
expiresAt: Date;
|
|
652
644
|
createdAt: Date;
|
|
653
|
-
}
|
|
645
|
+
} | {
|
|
646
|
+
id: string;
|
|
647
|
+
organizationId: string;
|
|
648
|
+
email: string;
|
|
649
|
+
role: "admin" | "member" | "owner";
|
|
650
|
+
status: better_auth_plugins0.InvitationStatus;
|
|
651
|
+
inviterId: string;
|
|
652
|
+
expiresAt: Date;
|
|
653
|
+
createdAt: Date;
|
|
654
|
+
}>, {
|
|
654
655
|
code?: string | undefined;
|
|
655
656
|
message?: string | undefined;
|
|
656
657
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
@@ -1130,25 +1131,25 @@ declare function createAuthClient(): {
|
|
|
1130
1131
|
token: string;
|
|
1131
1132
|
user: {
|
|
1132
1133
|
id: string;
|
|
1134
|
+
createdAt: Date;
|
|
1135
|
+
updatedAt: Date;
|
|
1133
1136
|
email: string;
|
|
1134
1137
|
emailVerified: boolean;
|
|
1135
1138
|
name: string;
|
|
1136
|
-
image
|
|
1137
|
-
|
|
1138
|
-
updatedAt: Date;
|
|
1139
|
-
};
|
|
1139
|
+
image?: string | null | undefined;
|
|
1140
|
+
} & Record<string, any>;
|
|
1140
1141
|
} | {
|
|
1141
1142
|
status: boolean;
|
|
1142
1143
|
token: null;
|
|
1143
1144
|
user: {
|
|
1144
1145
|
id: string;
|
|
1146
|
+
createdAt: Date;
|
|
1147
|
+
updatedAt: Date;
|
|
1145
1148
|
email: string;
|
|
1146
1149
|
emailVerified: boolean;
|
|
1147
1150
|
name: string;
|
|
1148
|
-
image
|
|
1149
|
-
|
|
1150
|
-
updatedAt: Date;
|
|
1151
|
-
};
|
|
1151
|
+
image?: string | null | undefined;
|
|
1152
|
+
} & Record<string, any>;
|
|
1152
1153
|
}>, {
|
|
1153
1154
|
code?: string | undefined;
|
|
1154
1155
|
message?: string | undefined;
|
|
@@ -1168,18 +1169,33 @@ declare function createAuthClient(): {
|
|
|
1168
1169
|
token: string;
|
|
1169
1170
|
user: {
|
|
1170
1171
|
id: string;
|
|
1172
|
+
createdAt: Date;
|
|
1173
|
+
updatedAt: Date;
|
|
1171
1174
|
email: string;
|
|
1172
1175
|
emailVerified: boolean;
|
|
1173
1176
|
name: string;
|
|
1174
|
-
image
|
|
1175
|
-
createdAt: Date;
|
|
1176
|
-
updatedAt: Date;
|
|
1177
|
+
image?: string | null | undefined;
|
|
1177
1178
|
};
|
|
1178
1179
|
}, {
|
|
1179
1180
|
code?: string | undefined;
|
|
1180
1181
|
message?: string | undefined;
|
|
1181
1182
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
1182
1183
|
};
|
|
1184
|
+
} & {
|
|
1185
|
+
emailOtp: {
|
|
1186
|
+
requestPasswordReset: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
|
|
1187
|
+
email: string;
|
|
1188
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
|
|
1189
|
+
email: string;
|
|
1190
|
+
} & {
|
|
1191
|
+
fetchOptions?: FetchOptions | undefined;
|
|
1192
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
|
|
1193
|
+
success: boolean;
|
|
1194
|
+
}, {
|
|
1195
|
+
code?: string | undefined;
|
|
1196
|
+
message?: string | undefined;
|
|
1197
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
1198
|
+
};
|
|
1183
1199
|
} & {
|
|
1184
1200
|
forgetPassword: {
|
|
1185
1201
|
emailOtp: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
|
|
@@ -1214,6 +1230,60 @@ declare function createAuthClient(): {
|
|
|
1214
1230
|
message?: string | undefined;
|
|
1215
1231
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
1216
1232
|
};
|
|
1233
|
+
} & {
|
|
1234
|
+
signIn: {
|
|
1235
|
+
magicLink: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
|
|
1236
|
+
email: string;
|
|
1237
|
+
name?: string | undefined;
|
|
1238
|
+
callbackURL?: string | undefined;
|
|
1239
|
+
newUserCallbackURL?: string | undefined;
|
|
1240
|
+
errorCallbackURL?: string | undefined;
|
|
1241
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
|
|
1242
|
+
email: string;
|
|
1243
|
+
name?: string | undefined;
|
|
1244
|
+
callbackURL?: string | undefined;
|
|
1245
|
+
newUserCallbackURL?: string | undefined;
|
|
1246
|
+
errorCallbackURL?: string | undefined;
|
|
1247
|
+
} & {
|
|
1248
|
+
fetchOptions?: FetchOptions | undefined;
|
|
1249
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
|
|
1250
|
+
status: boolean;
|
|
1251
|
+
}, {
|
|
1252
|
+
code?: string | undefined;
|
|
1253
|
+
message?: string | undefined;
|
|
1254
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
1255
|
+
};
|
|
1256
|
+
} & {
|
|
1257
|
+
magicLink: {
|
|
1258
|
+
verify: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<{
|
|
1259
|
+
token: string;
|
|
1260
|
+
callbackURL?: string | undefined;
|
|
1261
|
+
errorCallbackURL?: string | undefined;
|
|
1262
|
+
newUserCallbackURL?: string | undefined;
|
|
1263
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
|
|
1264
|
+
query: {
|
|
1265
|
+
token: string;
|
|
1266
|
+
callbackURL?: string | undefined;
|
|
1267
|
+
errorCallbackURL?: string | undefined;
|
|
1268
|
+
newUserCallbackURL?: string | undefined;
|
|
1269
|
+
};
|
|
1270
|
+
fetchOptions?: FetchOptions | undefined;
|
|
1271
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
|
|
1272
|
+
token: string;
|
|
1273
|
+
user: {
|
|
1274
|
+
id: string;
|
|
1275
|
+
createdAt: Date;
|
|
1276
|
+
updatedAt: Date;
|
|
1277
|
+
email: string;
|
|
1278
|
+
emailVerified: boolean;
|
|
1279
|
+
name: string;
|
|
1280
|
+
image?: string | null | undefined;
|
|
1281
|
+
};
|
|
1282
|
+
}, {
|
|
1283
|
+
code?: string | undefined;
|
|
1284
|
+
message?: string | undefined;
|
|
1285
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
1286
|
+
};
|
|
1217
1287
|
} & {
|
|
1218
1288
|
signIn: {
|
|
1219
1289
|
social: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
|
|
@@ -1436,13 +1506,13 @@ declare function createAuthClient(): {
|
|
|
1436
1506
|
token: string | null;
|
|
1437
1507
|
user: {
|
|
1438
1508
|
id: string;
|
|
1439
|
-
email: string;
|
|
1440
|
-
name: string;
|
|
1441
|
-
image: string | null | undefined;
|
|
1442
|
-
emailVerified: boolean;
|
|
1443
1509
|
createdAt: Date;
|
|
1444
1510
|
updatedAt: Date;
|
|
1445
|
-
|
|
1511
|
+
email: string;
|
|
1512
|
+
emailVerified: boolean;
|
|
1513
|
+
name: string;
|
|
1514
|
+
image?: string | null | undefined;
|
|
1515
|
+
} & Record<string, any>;
|
|
1446
1516
|
}, {
|
|
1447
1517
|
code?: string | undefined;
|
|
1448
1518
|
message?: string | undefined;
|
|
@@ -1606,13 +1676,13 @@ declare function createAuthClient(): {
|
|
|
1606
1676
|
query?: Record<string, any> | undefined;
|
|
1607
1677
|
fetchOptions?: FetchOptions | undefined;
|
|
1608
1678
|
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
|
|
1679
|
+
scopes: string[];
|
|
1609
1680
|
id: string;
|
|
1610
|
-
providerId: string;
|
|
1611
1681
|
createdAt: Date;
|
|
1612
1682
|
updatedAt: Date;
|
|
1613
|
-
accountId: string;
|
|
1614
1683
|
userId: string;
|
|
1615
|
-
|
|
1684
|
+
providerId: string;
|
|
1685
|
+
accountId: string;
|
|
1616
1686
|
}[], {
|
|
1617
1687
|
code?: string | undefined;
|
|
1618
1688
|
message?: string | undefined;
|
|
@@ -1975,6 +2045,7 @@ declare function createAuthClient(): {
|
|
|
1975
2045
|
})[];
|
|
1976
2046
|
cache?: RequestCache | undefined;
|
|
1977
2047
|
method: string;
|
|
2048
|
+
window?: null | undefined;
|
|
1978
2049
|
headers?: (HeadersInit & (HeadersInit | {
|
|
1979
2050
|
accept: "application/json" | "text/plain" | "application/octet-stream";
|
|
1980
2051
|
"content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
|
|
@@ -1989,7 +2060,6 @@ declare function createAuthClient(): {
|
|
|
1989
2060
|
referrer?: string | undefined;
|
|
1990
2061
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
1991
2062
|
signal?: (AbortSignal | null) | undefined;
|
|
1992
|
-
window?: null | undefined;
|
|
1993
2063
|
onRetry?: ((response: _better_fetch_fetch0.ResponseContext) => Promise<void> | void) | undefined;
|
|
1994
2064
|
hookOptions?: {
|
|
1995
2065
|
cloneResponse?: boolean;
|
|
@@ -2130,7 +2200,25 @@ declare function createAuthClient(): {
|
|
|
2130
2200
|
readonly FAILED_TO_UNLINK_LAST_ACCOUNT: "You can't unlink your last account";
|
|
2131
2201
|
readonly ACCOUNT_NOT_FOUND: "Account not found";
|
|
2132
2202
|
readonly USER_ALREADY_HAS_PASSWORD: "User already has a password. Provide that to delete the account.";
|
|
2203
|
+
readonly CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: "Cross-site navigation login blocked. This request appears to be a CSRF attack.";
|
|
2204
|
+
readonly VERIFICATION_EMAIL_NOT_ENABLED: "Verification email isn't enabled";
|
|
2205
|
+
readonly EMAIL_ALREADY_VERIFIED: "Email is already verified";
|
|
2206
|
+
readonly EMAIL_MISMATCH: "Email mismatch";
|
|
2207
|
+
readonly SESSION_NOT_FRESH: "Session is not fresh";
|
|
2208
|
+
readonly LINKED_ACCOUNT_ALREADY_EXISTS: "Linked account already exists";
|
|
2209
|
+
readonly INVALID_ORIGIN: "Invalid origin";
|
|
2210
|
+
readonly INVALID_CALLBACK_URL: "Invalid callbackURL";
|
|
2211
|
+
readonly INVALID_REDIRECT_URL: "Invalid redirectURL";
|
|
2212
|
+
readonly INVALID_ERROR_CALLBACK_URL: "Invalid errorCallbackURL";
|
|
2213
|
+
readonly INVALID_NEW_USER_CALLBACK_URL: "Invalid newUserCallbackURL";
|
|
2214
|
+
readonly MISSING_OR_NULL_ORIGIN: "Missing or null Origin";
|
|
2215
|
+
readonly CALLBACK_URL_REQUIRED: "callbackURL is required";
|
|
2216
|
+
readonly FAILED_TO_CREATE_VERIFICATION: "Unable to create verification";
|
|
2217
|
+
readonly FIELD_NOT_ALLOWED: "Field not allowed to be set";
|
|
2218
|
+
readonly ASYNC_VALIDATION_NOT_SUPPORTED: "Async validation is not supported";
|
|
2219
|
+
readonly VALIDATION_ERROR: "Validation Error";
|
|
2220
|
+
readonly MISSING_FIELD: "Field is required";
|
|
2133
2221
|
};
|
|
2134
2222
|
};
|
|
2135
2223
|
//#endregion
|
|
2136
|
-
export { createAuthClient };
|
|
2224
|
+
export { AuthApiError, AuthError, createAuthClient, isAuthApiError, isAuthError };
|
package/dist/next/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import "../adapter-core-
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
1
|
+
import "../adapter-core-Bt4M5I2g.mjs";
|
|
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-aMv8WeDb.mjs";
|
|
4
|
+
import { t as createAuthClient$1 } from "../neon-auth-CS4FpK2X.mjs";
|
|
4
5
|
|
|
5
6
|
//#region src/next/index.ts
|
|
6
7
|
function createAuthClient() {
|
|
@@ -8,4 +9,4 @@ function createAuthClient() {
|
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
//#endregion
|
|
11
|
-
export { createAuthClient };
|
|
12
|
+
export { AuthApiError, AuthError, createAuthClient, isAuthApiError, isAuthError };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
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";
|
|
2
3
|
import { NextRequest, NextResponse } from "next/server";
|
|
3
4
|
|
|
4
5
|
//#region src/server/config.d.ts
|
|
5
|
-
|
|
6
6
|
/**
|
|
7
7
|
* Framework-agnostic configuration types for Neon Auth
|
|
8
8
|
*/
|
|
9
|
+
/** Allowed values for the `SameSite` attribute on Neon Auth cookies. */
|
|
10
|
+
type SessionCookieSameSite = 'strict' | 'lax' | 'none';
|
|
9
11
|
/**
|
|
10
12
|
* Session cookie configuration
|
|
11
13
|
*/
|
|
@@ -41,6 +43,16 @@ interface SessionCookieConfig {
|
|
|
41
43
|
* @example '.example.com' // Share across subdomains
|
|
42
44
|
*/
|
|
43
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;
|
|
44
56
|
}
|
|
45
57
|
/**
|
|
46
58
|
* Base configuration for Neon Auth server utilities
|
|
@@ -198,6 +210,10 @@ declare const API_ENDPOINTS: {
|
|
|
198
210
|
readonly path: "sign-in/email-otp";
|
|
199
211
|
readonly method: "POST";
|
|
200
212
|
};
|
|
213
|
+
readonly magicLink: {
|
|
214
|
+
readonly path: "sign-in/magic-link";
|
|
215
|
+
readonly method: "POST";
|
|
216
|
+
};
|
|
201
217
|
};
|
|
202
218
|
readonly signUp: {
|
|
203
219
|
readonly email: {
|
|
@@ -419,6 +435,12 @@ declare const API_ENDPOINTS: {
|
|
|
419
435
|
readonly method: "POST";
|
|
420
436
|
};
|
|
421
437
|
};
|
|
438
|
+
readonly magicLink: {
|
|
439
|
+
readonly verify: {
|
|
440
|
+
readonly path: "magic-link/verify";
|
|
441
|
+
readonly method: "GET";
|
|
442
|
+
};
|
|
443
|
+
};
|
|
422
444
|
};
|
|
423
445
|
//#endregion
|
|
424
446
|
//#region src/server/types.d.ts
|
|
@@ -533,4 +555,4 @@ type NeonAuth = NeonAuthServer & {
|
|
|
533
555
|
middleware: (middlewareConfig?: Pick<NeonAuthMiddlewareConfig, 'loginUrl'>) => ReturnType<typeof neonAuthMiddleware>;
|
|
534
556
|
};
|
|
535
557
|
//#endregion
|
|
536
|
-
export { NeonAuth, createNeonAuth };
|
|
558
|
+
export { AuthApiError, AuthError, NeonAuth, createNeonAuth, isAuthApiError, isAuthError };
|