@xk2800/nextjs-template 0.7.1-beta.14 → 0.7.1-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/components/auth/oneTap.tsx +9 -1
- package/components/dashboard/deleteAccountCard.tsx +31 -4
- package/dist/api/feedback.js +498 -63
- package/dist/api/feedback.js.map +1 -1
- package/dist/api/feedback.mjs +1 -1
- package/dist/api/marketing.js +498 -63
- package/dist/api/marketing.js.map +1 -1
- package/dist/api/marketing.mjs +2 -2
- package/dist/auth/helpers.js +496 -61
- package/dist/auth/helpers.js.map +1 -1
- package/dist/auth/helpers.mjs +2 -2
- package/dist/auth/index.d.mts +142 -10
- package/dist/auth/index.d.ts +142 -10
- package/dist/auth/index.js +496 -61
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/index.mjs +1 -1
- package/dist/{chunk-6Z3WUSDJ.mjs → chunk-A2K3FVDH.mjs} +3 -3
- package/dist/{chunk-6Z3WUSDJ.mjs.map → chunk-A2K3FVDH.mjs.map} +1 -1
- package/dist/chunk-WJMWCE2I.mjs +897 -0
- package/dist/chunk-WJMWCE2I.mjs.map +1 -0
- package/package.json +2 -2
- package/dist/chunk-7QVIOQ47.mjs +0 -462
- package/dist/chunk-7QVIOQ47.mjs.map +0 -1
package/dist/auth/helpers.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { getCurrentSession, hasRole, normalizeCallbackUrl, requireAuth, requireRole } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { getCurrentSession, hasRole, normalizeCallbackUrl, requireAuth, requireRole } from '../chunk-A2K3FVDH.mjs';
|
|
2
|
+
import '../chunk-WJMWCE2I.mjs';
|
|
3
3
|
import '../chunk-7F2POZM6.mjs';
|
|
4
4
|
import '../chunk-6OAHCEDJ.mjs';
|
|
5
5
|
import '../chunk-P2G23JMY.mjs';
|
package/dist/auth/index.d.mts
CHANGED
|
@@ -5,10 +5,54 @@ import * as zod from 'zod';
|
|
|
5
5
|
import * as better_auth_plugins from 'better-auth/plugins';
|
|
6
6
|
import * as better_call from 'better-call';
|
|
7
7
|
import * as better_auth from 'better-auth';
|
|
8
|
-
import { BetterAuthOptions } from 'better-auth';
|
|
8
|
+
import { BetterAuthOptions, BetterAuthPlugin } from 'better-auth';
|
|
9
|
+
import { createAuthMiddleware } from 'better-auth/api';
|
|
9
10
|
|
|
11
|
+
type AuthMiddleware = ReturnType<typeof createAuthMiddleware>;
|
|
12
|
+
type DatabaseHooks = NonNullable<BetterAuthOptions["databaseHooks"]>;
|
|
13
|
+
type CreateAfter<M extends "user" | "session"> = NonNullable<NonNullable<NonNullable<DatabaseHooks[M]>["create"]>["after"]>;
|
|
10
14
|
type AuthOverrides = {
|
|
11
15
|
socialProviders?: BetterAuthOptions["socialProviders"];
|
|
16
|
+
/** App hooks. They run after the package's own hooks, so its guards still apply. */
|
|
17
|
+
hooks?: {
|
|
18
|
+
before?: AuthMiddleware;
|
|
19
|
+
after?: AuthMiddleware;
|
|
20
|
+
};
|
|
21
|
+
/** App database hooks, run after the package's own (e.g. start a trial on signup). */
|
|
22
|
+
databaseHooks?: {
|
|
23
|
+
user?: {
|
|
24
|
+
create?: {
|
|
25
|
+
after?: CreateAfter<"user">;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
session?: {
|
|
29
|
+
create?: {
|
|
30
|
+
after?: CreateAfter<"session">;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/** Extra better-auth plugins, appended after the package's. */
|
|
35
|
+
plugins?: BetterAuthPlugin[];
|
|
36
|
+
/** e.g. crossSubDomainCookies when login and marketing live on different subdomains. */
|
|
37
|
+
advanced?: Pick<NonNullable<BetterAuthOptions["advanced"]>, "crossSubDomainCookies">;
|
|
38
|
+
/** better-auth's rate limiter (off outside production by default). */
|
|
39
|
+
rateLimit?: BetterAuthOptions["rateLimit"];
|
|
40
|
+
twoFactor?: {
|
|
41
|
+
/**
|
|
42
|
+
* For apps whose users have no password (OAuth-only). Enabling 2FA needs no
|
|
43
|
+
* password; disabling it or regenerating backup codes needs a current TOTP `code`.
|
|
44
|
+
*/
|
|
45
|
+
passwordless?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Also ask for the code after Google and One Tap sign-in (stock better-auth only
|
|
48
|
+
* asks after email/password). Needs the /login/2fa page. Default false.
|
|
49
|
+
*/
|
|
50
|
+
challengeAfterOAuth?: boolean;
|
|
51
|
+
};
|
|
52
|
+
/** Admins can sign in as a user ("impersonate"). Default true. */
|
|
53
|
+
impersonation?: boolean;
|
|
54
|
+
/** Self-service "Delete account" (better-auth's /delete-user). Default true. */
|
|
55
|
+
deleteUser?: boolean;
|
|
12
56
|
};
|
|
13
57
|
declare function createAuth(overrides?: AuthOverrides): better_auth.Auth<{
|
|
14
58
|
database: (options: BetterAuthOptions) => better_auth.DBAdapter<BetterAuthOptions>;
|
|
@@ -48,15 +92,34 @@ declare function createAuth(overrides?: AuthOverrides): better_auth.Auth<{
|
|
|
48
92
|
};
|
|
49
93
|
};
|
|
50
94
|
deleteUser: {
|
|
51
|
-
enabled:
|
|
95
|
+
enabled: boolean;
|
|
52
96
|
};
|
|
53
97
|
};
|
|
54
98
|
advanced: {
|
|
55
99
|
database: {
|
|
56
100
|
generateId: () => string;
|
|
57
101
|
};
|
|
102
|
+
crossSubDomainCookies?: {
|
|
103
|
+
enabled: boolean;
|
|
104
|
+
additionalCookies?: string[];
|
|
105
|
+
domain?: string;
|
|
106
|
+
} | undefined;
|
|
58
107
|
};
|
|
108
|
+
rateLimit: better_auth.BetterAuthRateLimitOptions | undefined;
|
|
59
109
|
databaseHooks: {
|
|
110
|
+
user: {
|
|
111
|
+
create: {
|
|
112
|
+
after(user: {
|
|
113
|
+
id: string;
|
|
114
|
+
createdAt: Date;
|
|
115
|
+
updatedAt: Date;
|
|
116
|
+
email: string;
|
|
117
|
+
emailVerified: boolean;
|
|
118
|
+
name: string;
|
|
119
|
+
image?: string | null | undefined;
|
|
120
|
+
} & Record<string, unknown>, context: better_auth.GenericEndpointContext | null): Promise<void>;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
60
123
|
session: {
|
|
61
124
|
create: {
|
|
62
125
|
after(session: {
|
|
@@ -891,7 +954,7 @@ declare function createAuth(overrides?: AuthOverrides): better_auth.Auth<{
|
|
|
891
954
|
$Infer: {
|
|
892
955
|
body: {
|
|
893
956
|
permissions: {
|
|
894
|
-
readonly user?: ("delete" | "update" | "list" | "
|
|
957
|
+
readonly user?: ("delete" | "update" | "list" | "create" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "set-password" | "set-email" | "get")[] | undefined;
|
|
895
958
|
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
896
959
|
};
|
|
897
960
|
} & {
|
|
@@ -1560,6 +1623,7 @@ declare function createAuth(overrides?: AuthOverrides): better_auth.Auth<{
|
|
|
1560
1623
|
};
|
|
1561
1624
|
options: NoInfer<{
|
|
1562
1625
|
issuer: string;
|
|
1626
|
+
allowPasswordless: boolean;
|
|
1563
1627
|
}>;
|
|
1564
1628
|
hooks: {
|
|
1565
1629
|
after: {
|
|
@@ -1646,6 +1710,18 @@ declare function createAuth(overrides?: AuthOverrides): better_auth.Auth<{
|
|
|
1646
1710
|
ACCOUNT_TEMPORARILY_LOCKED: better_auth.RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
|
|
1647
1711
|
INVALID_TWO_FACTOR_COOKIE: better_auth.RawError<"INVALID_TWO_FACTOR_COOKIE">;
|
|
1648
1712
|
};
|
|
1713
|
+
}, {
|
|
1714
|
+
id: "two-factor-extras";
|
|
1715
|
+
hooks: {
|
|
1716
|
+
before: {
|
|
1717
|
+
matcher: (ctx: better_auth.HookEndpointContext) => boolean;
|
|
1718
|
+
handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<void>>;
|
|
1719
|
+
}[];
|
|
1720
|
+
after: {
|
|
1721
|
+
matcher: (ctx: better_auth.HookEndpointContext) => boolean;
|
|
1722
|
+
handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<void>>;
|
|
1723
|
+
}[];
|
|
1724
|
+
};
|
|
1649
1725
|
}, {
|
|
1650
1726
|
id: "passkey";
|
|
1651
1727
|
version: string;
|
|
@@ -2239,7 +2315,19 @@ declare function createAuth(overrides?: AuthOverrides): better_auth.Auth<{
|
|
|
2239
2315
|
RESOLVED_USER_INVALID: better_auth.RawError<"RESOLVED_USER_INVALID">;
|
|
2240
2316
|
};
|
|
2241
2317
|
options: _better_auth_passkey.PasskeyOptions | undefined;
|
|
2242
|
-
}, ...{
|
|
2318
|
+
}, ...(BetterAuthPlugin | {
|
|
2319
|
+
id: "app-hooks";
|
|
2320
|
+
hooks: {
|
|
2321
|
+
before: {
|
|
2322
|
+
matcher: () => true;
|
|
2323
|
+
handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<unknown>>;
|
|
2324
|
+
}[];
|
|
2325
|
+
after: {
|
|
2326
|
+
matcher: () => true;
|
|
2327
|
+
handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<unknown>>;
|
|
2328
|
+
}[];
|
|
2329
|
+
};
|
|
2330
|
+
} | {
|
|
2243
2331
|
id: "one-tap";
|
|
2244
2332
|
version: string;
|
|
2245
2333
|
endpoints: {
|
|
@@ -2292,7 +2380,7 @@ declare function createAuth(overrides?: AuthOverrides): better_auth.Auth<{
|
|
|
2292
2380
|
}>;
|
|
2293
2381
|
};
|
|
2294
2382
|
options: better_auth_plugins.OneTapOptions | undefined;
|
|
2295
|
-
}[]];
|
|
2383
|
+
})[]];
|
|
2296
2384
|
}>;
|
|
2297
2385
|
declare const auth: better_auth.Auth<{
|
|
2298
2386
|
database: (options: BetterAuthOptions) => better_auth.DBAdapter<BetterAuthOptions>;
|
|
@@ -2332,15 +2420,34 @@ declare const auth: better_auth.Auth<{
|
|
|
2332
2420
|
};
|
|
2333
2421
|
};
|
|
2334
2422
|
deleteUser: {
|
|
2335
|
-
enabled:
|
|
2423
|
+
enabled: boolean;
|
|
2336
2424
|
};
|
|
2337
2425
|
};
|
|
2338
2426
|
advanced: {
|
|
2339
2427
|
database: {
|
|
2340
2428
|
generateId: () => string;
|
|
2341
2429
|
};
|
|
2430
|
+
crossSubDomainCookies?: {
|
|
2431
|
+
enabled: boolean;
|
|
2432
|
+
additionalCookies?: string[];
|
|
2433
|
+
domain?: string;
|
|
2434
|
+
} | undefined;
|
|
2342
2435
|
};
|
|
2436
|
+
rateLimit: better_auth.BetterAuthRateLimitOptions | undefined;
|
|
2343
2437
|
databaseHooks: {
|
|
2438
|
+
user: {
|
|
2439
|
+
create: {
|
|
2440
|
+
after(user: {
|
|
2441
|
+
id: string;
|
|
2442
|
+
createdAt: Date;
|
|
2443
|
+
updatedAt: Date;
|
|
2444
|
+
email: string;
|
|
2445
|
+
emailVerified: boolean;
|
|
2446
|
+
name: string;
|
|
2447
|
+
image?: string | null | undefined;
|
|
2448
|
+
} & Record<string, unknown>, context: better_auth.GenericEndpointContext | null): Promise<void>;
|
|
2449
|
+
};
|
|
2450
|
+
};
|
|
2344
2451
|
session: {
|
|
2345
2452
|
create: {
|
|
2346
2453
|
after(session: {
|
|
@@ -3175,7 +3282,7 @@ declare const auth: better_auth.Auth<{
|
|
|
3175
3282
|
$Infer: {
|
|
3176
3283
|
body: {
|
|
3177
3284
|
permissions: {
|
|
3178
|
-
readonly user?: ("delete" | "update" | "list" | "
|
|
3285
|
+
readonly user?: ("delete" | "update" | "list" | "create" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "set-password" | "set-email" | "get")[] | undefined;
|
|
3179
3286
|
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
3180
3287
|
};
|
|
3181
3288
|
} & {
|
|
@@ -3844,6 +3951,7 @@ declare const auth: better_auth.Auth<{
|
|
|
3844
3951
|
};
|
|
3845
3952
|
options: NoInfer<{
|
|
3846
3953
|
issuer: string;
|
|
3954
|
+
allowPasswordless: boolean;
|
|
3847
3955
|
}>;
|
|
3848
3956
|
hooks: {
|
|
3849
3957
|
after: {
|
|
@@ -3930,6 +4038,18 @@ declare const auth: better_auth.Auth<{
|
|
|
3930
4038
|
ACCOUNT_TEMPORARILY_LOCKED: better_auth.RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
|
|
3931
4039
|
INVALID_TWO_FACTOR_COOKIE: better_auth.RawError<"INVALID_TWO_FACTOR_COOKIE">;
|
|
3932
4040
|
};
|
|
4041
|
+
}, {
|
|
4042
|
+
id: "two-factor-extras";
|
|
4043
|
+
hooks: {
|
|
4044
|
+
before: {
|
|
4045
|
+
matcher: (ctx: better_auth.HookEndpointContext) => boolean;
|
|
4046
|
+
handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<void>>;
|
|
4047
|
+
}[];
|
|
4048
|
+
after: {
|
|
4049
|
+
matcher: (ctx: better_auth.HookEndpointContext) => boolean;
|
|
4050
|
+
handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<void>>;
|
|
4051
|
+
}[];
|
|
4052
|
+
};
|
|
3933
4053
|
}, {
|
|
3934
4054
|
id: "passkey";
|
|
3935
4055
|
version: string;
|
|
@@ -4523,7 +4643,19 @@ declare const auth: better_auth.Auth<{
|
|
|
4523
4643
|
RESOLVED_USER_INVALID: better_auth.RawError<"RESOLVED_USER_INVALID">;
|
|
4524
4644
|
};
|
|
4525
4645
|
options: _better_auth_passkey.PasskeyOptions | undefined;
|
|
4526
|
-
}, ...{
|
|
4646
|
+
}, ...(BetterAuthPlugin | {
|
|
4647
|
+
id: "app-hooks";
|
|
4648
|
+
hooks: {
|
|
4649
|
+
before: {
|
|
4650
|
+
matcher: () => true;
|
|
4651
|
+
handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<unknown>>;
|
|
4652
|
+
}[];
|
|
4653
|
+
after: {
|
|
4654
|
+
matcher: () => true;
|
|
4655
|
+
handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<unknown>>;
|
|
4656
|
+
}[];
|
|
4657
|
+
};
|
|
4658
|
+
} | {
|
|
4527
4659
|
id: "one-tap";
|
|
4528
4660
|
version: string;
|
|
4529
4661
|
endpoints: {
|
|
@@ -4576,7 +4708,7 @@ declare const auth: better_auth.Auth<{
|
|
|
4576
4708
|
}>;
|
|
4577
4709
|
};
|
|
4578
4710
|
options: better_auth_plugins.OneTapOptions | undefined;
|
|
4579
|
-
}[]];
|
|
4711
|
+
})[]];
|
|
4580
4712
|
}>;
|
|
4581
4713
|
|
|
4582
|
-
export { auth, createAuth };
|
|
4714
|
+
export { type AuthOverrides, auth, createAuth };
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -5,10 +5,54 @@ import * as zod from 'zod';
|
|
|
5
5
|
import * as better_auth_plugins from 'better-auth/plugins';
|
|
6
6
|
import * as better_call from 'better-call';
|
|
7
7
|
import * as better_auth from 'better-auth';
|
|
8
|
-
import { BetterAuthOptions } from 'better-auth';
|
|
8
|
+
import { BetterAuthOptions, BetterAuthPlugin } from 'better-auth';
|
|
9
|
+
import { createAuthMiddleware } from 'better-auth/api';
|
|
9
10
|
|
|
11
|
+
type AuthMiddleware = ReturnType<typeof createAuthMiddleware>;
|
|
12
|
+
type DatabaseHooks = NonNullable<BetterAuthOptions["databaseHooks"]>;
|
|
13
|
+
type CreateAfter<M extends "user" | "session"> = NonNullable<NonNullable<NonNullable<DatabaseHooks[M]>["create"]>["after"]>;
|
|
10
14
|
type AuthOverrides = {
|
|
11
15
|
socialProviders?: BetterAuthOptions["socialProviders"];
|
|
16
|
+
/** App hooks. They run after the package's own hooks, so its guards still apply. */
|
|
17
|
+
hooks?: {
|
|
18
|
+
before?: AuthMiddleware;
|
|
19
|
+
after?: AuthMiddleware;
|
|
20
|
+
};
|
|
21
|
+
/** App database hooks, run after the package's own (e.g. start a trial on signup). */
|
|
22
|
+
databaseHooks?: {
|
|
23
|
+
user?: {
|
|
24
|
+
create?: {
|
|
25
|
+
after?: CreateAfter<"user">;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
session?: {
|
|
29
|
+
create?: {
|
|
30
|
+
after?: CreateAfter<"session">;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/** Extra better-auth plugins, appended after the package's. */
|
|
35
|
+
plugins?: BetterAuthPlugin[];
|
|
36
|
+
/** e.g. crossSubDomainCookies when login and marketing live on different subdomains. */
|
|
37
|
+
advanced?: Pick<NonNullable<BetterAuthOptions["advanced"]>, "crossSubDomainCookies">;
|
|
38
|
+
/** better-auth's rate limiter (off outside production by default). */
|
|
39
|
+
rateLimit?: BetterAuthOptions["rateLimit"];
|
|
40
|
+
twoFactor?: {
|
|
41
|
+
/**
|
|
42
|
+
* For apps whose users have no password (OAuth-only). Enabling 2FA needs no
|
|
43
|
+
* password; disabling it or regenerating backup codes needs a current TOTP `code`.
|
|
44
|
+
*/
|
|
45
|
+
passwordless?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Also ask for the code after Google and One Tap sign-in (stock better-auth only
|
|
48
|
+
* asks after email/password). Needs the /login/2fa page. Default false.
|
|
49
|
+
*/
|
|
50
|
+
challengeAfterOAuth?: boolean;
|
|
51
|
+
};
|
|
52
|
+
/** Admins can sign in as a user ("impersonate"). Default true. */
|
|
53
|
+
impersonation?: boolean;
|
|
54
|
+
/** Self-service "Delete account" (better-auth's /delete-user). Default true. */
|
|
55
|
+
deleteUser?: boolean;
|
|
12
56
|
};
|
|
13
57
|
declare function createAuth(overrides?: AuthOverrides): better_auth.Auth<{
|
|
14
58
|
database: (options: BetterAuthOptions) => better_auth.DBAdapter<BetterAuthOptions>;
|
|
@@ -48,15 +92,34 @@ declare function createAuth(overrides?: AuthOverrides): better_auth.Auth<{
|
|
|
48
92
|
};
|
|
49
93
|
};
|
|
50
94
|
deleteUser: {
|
|
51
|
-
enabled:
|
|
95
|
+
enabled: boolean;
|
|
52
96
|
};
|
|
53
97
|
};
|
|
54
98
|
advanced: {
|
|
55
99
|
database: {
|
|
56
100
|
generateId: () => string;
|
|
57
101
|
};
|
|
102
|
+
crossSubDomainCookies?: {
|
|
103
|
+
enabled: boolean;
|
|
104
|
+
additionalCookies?: string[];
|
|
105
|
+
domain?: string;
|
|
106
|
+
} | undefined;
|
|
58
107
|
};
|
|
108
|
+
rateLimit: better_auth.BetterAuthRateLimitOptions | undefined;
|
|
59
109
|
databaseHooks: {
|
|
110
|
+
user: {
|
|
111
|
+
create: {
|
|
112
|
+
after(user: {
|
|
113
|
+
id: string;
|
|
114
|
+
createdAt: Date;
|
|
115
|
+
updatedAt: Date;
|
|
116
|
+
email: string;
|
|
117
|
+
emailVerified: boolean;
|
|
118
|
+
name: string;
|
|
119
|
+
image?: string | null | undefined;
|
|
120
|
+
} & Record<string, unknown>, context: better_auth.GenericEndpointContext | null): Promise<void>;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
60
123
|
session: {
|
|
61
124
|
create: {
|
|
62
125
|
after(session: {
|
|
@@ -891,7 +954,7 @@ declare function createAuth(overrides?: AuthOverrides): better_auth.Auth<{
|
|
|
891
954
|
$Infer: {
|
|
892
955
|
body: {
|
|
893
956
|
permissions: {
|
|
894
|
-
readonly user?: ("delete" | "update" | "list" | "
|
|
957
|
+
readonly user?: ("delete" | "update" | "list" | "create" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "set-password" | "set-email" | "get")[] | undefined;
|
|
895
958
|
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
896
959
|
};
|
|
897
960
|
} & {
|
|
@@ -1560,6 +1623,7 @@ declare function createAuth(overrides?: AuthOverrides): better_auth.Auth<{
|
|
|
1560
1623
|
};
|
|
1561
1624
|
options: NoInfer<{
|
|
1562
1625
|
issuer: string;
|
|
1626
|
+
allowPasswordless: boolean;
|
|
1563
1627
|
}>;
|
|
1564
1628
|
hooks: {
|
|
1565
1629
|
after: {
|
|
@@ -1646,6 +1710,18 @@ declare function createAuth(overrides?: AuthOverrides): better_auth.Auth<{
|
|
|
1646
1710
|
ACCOUNT_TEMPORARILY_LOCKED: better_auth.RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
|
|
1647
1711
|
INVALID_TWO_FACTOR_COOKIE: better_auth.RawError<"INVALID_TWO_FACTOR_COOKIE">;
|
|
1648
1712
|
};
|
|
1713
|
+
}, {
|
|
1714
|
+
id: "two-factor-extras";
|
|
1715
|
+
hooks: {
|
|
1716
|
+
before: {
|
|
1717
|
+
matcher: (ctx: better_auth.HookEndpointContext) => boolean;
|
|
1718
|
+
handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<void>>;
|
|
1719
|
+
}[];
|
|
1720
|
+
after: {
|
|
1721
|
+
matcher: (ctx: better_auth.HookEndpointContext) => boolean;
|
|
1722
|
+
handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<void>>;
|
|
1723
|
+
}[];
|
|
1724
|
+
};
|
|
1649
1725
|
}, {
|
|
1650
1726
|
id: "passkey";
|
|
1651
1727
|
version: string;
|
|
@@ -2239,7 +2315,19 @@ declare function createAuth(overrides?: AuthOverrides): better_auth.Auth<{
|
|
|
2239
2315
|
RESOLVED_USER_INVALID: better_auth.RawError<"RESOLVED_USER_INVALID">;
|
|
2240
2316
|
};
|
|
2241
2317
|
options: _better_auth_passkey.PasskeyOptions | undefined;
|
|
2242
|
-
}, ...{
|
|
2318
|
+
}, ...(BetterAuthPlugin | {
|
|
2319
|
+
id: "app-hooks";
|
|
2320
|
+
hooks: {
|
|
2321
|
+
before: {
|
|
2322
|
+
matcher: () => true;
|
|
2323
|
+
handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<unknown>>;
|
|
2324
|
+
}[];
|
|
2325
|
+
after: {
|
|
2326
|
+
matcher: () => true;
|
|
2327
|
+
handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<unknown>>;
|
|
2328
|
+
}[];
|
|
2329
|
+
};
|
|
2330
|
+
} | {
|
|
2243
2331
|
id: "one-tap";
|
|
2244
2332
|
version: string;
|
|
2245
2333
|
endpoints: {
|
|
@@ -2292,7 +2380,7 @@ declare function createAuth(overrides?: AuthOverrides): better_auth.Auth<{
|
|
|
2292
2380
|
}>;
|
|
2293
2381
|
};
|
|
2294
2382
|
options: better_auth_plugins.OneTapOptions | undefined;
|
|
2295
|
-
}[]];
|
|
2383
|
+
})[]];
|
|
2296
2384
|
}>;
|
|
2297
2385
|
declare const auth: better_auth.Auth<{
|
|
2298
2386
|
database: (options: BetterAuthOptions) => better_auth.DBAdapter<BetterAuthOptions>;
|
|
@@ -2332,15 +2420,34 @@ declare const auth: better_auth.Auth<{
|
|
|
2332
2420
|
};
|
|
2333
2421
|
};
|
|
2334
2422
|
deleteUser: {
|
|
2335
|
-
enabled:
|
|
2423
|
+
enabled: boolean;
|
|
2336
2424
|
};
|
|
2337
2425
|
};
|
|
2338
2426
|
advanced: {
|
|
2339
2427
|
database: {
|
|
2340
2428
|
generateId: () => string;
|
|
2341
2429
|
};
|
|
2430
|
+
crossSubDomainCookies?: {
|
|
2431
|
+
enabled: boolean;
|
|
2432
|
+
additionalCookies?: string[];
|
|
2433
|
+
domain?: string;
|
|
2434
|
+
} | undefined;
|
|
2342
2435
|
};
|
|
2436
|
+
rateLimit: better_auth.BetterAuthRateLimitOptions | undefined;
|
|
2343
2437
|
databaseHooks: {
|
|
2438
|
+
user: {
|
|
2439
|
+
create: {
|
|
2440
|
+
after(user: {
|
|
2441
|
+
id: string;
|
|
2442
|
+
createdAt: Date;
|
|
2443
|
+
updatedAt: Date;
|
|
2444
|
+
email: string;
|
|
2445
|
+
emailVerified: boolean;
|
|
2446
|
+
name: string;
|
|
2447
|
+
image?: string | null | undefined;
|
|
2448
|
+
} & Record<string, unknown>, context: better_auth.GenericEndpointContext | null): Promise<void>;
|
|
2449
|
+
};
|
|
2450
|
+
};
|
|
2344
2451
|
session: {
|
|
2345
2452
|
create: {
|
|
2346
2453
|
after(session: {
|
|
@@ -3175,7 +3282,7 @@ declare const auth: better_auth.Auth<{
|
|
|
3175
3282
|
$Infer: {
|
|
3176
3283
|
body: {
|
|
3177
3284
|
permissions: {
|
|
3178
|
-
readonly user?: ("delete" | "update" | "list" | "
|
|
3285
|
+
readonly user?: ("delete" | "update" | "list" | "create" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "set-password" | "set-email" | "get")[] | undefined;
|
|
3179
3286
|
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
3180
3287
|
};
|
|
3181
3288
|
} & {
|
|
@@ -3844,6 +3951,7 @@ declare const auth: better_auth.Auth<{
|
|
|
3844
3951
|
};
|
|
3845
3952
|
options: NoInfer<{
|
|
3846
3953
|
issuer: string;
|
|
3954
|
+
allowPasswordless: boolean;
|
|
3847
3955
|
}>;
|
|
3848
3956
|
hooks: {
|
|
3849
3957
|
after: {
|
|
@@ -3930,6 +4038,18 @@ declare const auth: better_auth.Auth<{
|
|
|
3930
4038
|
ACCOUNT_TEMPORARILY_LOCKED: better_auth.RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
|
|
3931
4039
|
INVALID_TWO_FACTOR_COOKIE: better_auth.RawError<"INVALID_TWO_FACTOR_COOKIE">;
|
|
3932
4040
|
};
|
|
4041
|
+
}, {
|
|
4042
|
+
id: "two-factor-extras";
|
|
4043
|
+
hooks: {
|
|
4044
|
+
before: {
|
|
4045
|
+
matcher: (ctx: better_auth.HookEndpointContext) => boolean;
|
|
4046
|
+
handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<void>>;
|
|
4047
|
+
}[];
|
|
4048
|
+
after: {
|
|
4049
|
+
matcher: (ctx: better_auth.HookEndpointContext) => boolean;
|
|
4050
|
+
handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<void>>;
|
|
4051
|
+
}[];
|
|
4052
|
+
};
|
|
3933
4053
|
}, {
|
|
3934
4054
|
id: "passkey";
|
|
3935
4055
|
version: string;
|
|
@@ -4523,7 +4643,19 @@ declare const auth: better_auth.Auth<{
|
|
|
4523
4643
|
RESOLVED_USER_INVALID: better_auth.RawError<"RESOLVED_USER_INVALID">;
|
|
4524
4644
|
};
|
|
4525
4645
|
options: _better_auth_passkey.PasskeyOptions | undefined;
|
|
4526
|
-
}, ...{
|
|
4646
|
+
}, ...(BetterAuthPlugin | {
|
|
4647
|
+
id: "app-hooks";
|
|
4648
|
+
hooks: {
|
|
4649
|
+
before: {
|
|
4650
|
+
matcher: () => true;
|
|
4651
|
+
handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<unknown>>;
|
|
4652
|
+
}[];
|
|
4653
|
+
after: {
|
|
4654
|
+
matcher: () => true;
|
|
4655
|
+
handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<unknown>>;
|
|
4656
|
+
}[];
|
|
4657
|
+
};
|
|
4658
|
+
} | {
|
|
4527
4659
|
id: "one-tap";
|
|
4528
4660
|
version: string;
|
|
4529
4661
|
endpoints: {
|
|
@@ -4576,7 +4708,7 @@ declare const auth: better_auth.Auth<{
|
|
|
4576
4708
|
}>;
|
|
4577
4709
|
};
|
|
4578
4710
|
options: better_auth_plugins.OneTapOptions | undefined;
|
|
4579
|
-
}[]];
|
|
4711
|
+
})[]];
|
|
4580
4712
|
}>;
|
|
4581
4713
|
|
|
4582
|
-
export { auth, createAuth };
|
|
4714
|
+
export { type AuthOverrides, auth, createAuth };
|