better-auth 1.6.26 → 1.6.28
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/adapters/index.d.mts +6 -1
- package/dist/api/dispatch.d.mts +1 -0
- package/dist/api/index.d.mts +508 -505
- package/dist/api/middlewares/authorization.d.mts +10 -14
- package/dist/api/middlewares/authorization.mjs +1 -2
- package/dist/api/middlewares/index.d.mts +1 -2
- package/dist/api/middlewares/origin-check.d.mts +5 -3
- package/dist/api/routes/account.d.mts +16 -13
- package/dist/api/routes/callback.d.mts +3 -1
- package/dist/api/routes/email-verification.d.mts +8 -4
- package/dist/api/routes/error.d.mts +3 -1
- package/dist/api/routes/index.d.mts +1 -2
- package/dist/api/routes/ok.d.mts +3 -1
- package/dist/api/routes/password.d.mts +10 -8
- package/dist/api/routes/session.d.mts +32 -30
- package/dist/api/routes/session.mjs +2 -3
- package/dist/api/routes/sign-in.d.mts +5 -3
- package/dist/api/routes/sign-out.d.mts +3 -1
- package/dist/api/routes/sign-up.d.mts +4 -3
- package/dist/api/routes/update-session.d.mts +5 -4
- package/dist/api/routes/update-user.d.mts +19 -18
- package/dist/auth/full.d.mts +1 -1
- package/dist/auth/minimal.d.mts +1 -1
- package/dist/client/config.d.mts +14 -12
- package/dist/client/config.mjs +2 -2
- package/dist/client/equality.d.mts +1 -0
- package/dist/client/index.d.mts +5 -6
- package/dist/client/lynx/index.d.mts +5 -4
- package/dist/client/lynx/lynx-store.d.mts +2 -1
- package/dist/client/parser.d.mts +3 -7
- package/dist/client/path-to-object.d.mts +4 -3
- package/dist/client/plugins/index.d.mts +1 -1
- package/dist/client/plugins/infer-plugin.d.mts +1 -0
- package/dist/client/query.d.mts +1 -0
- package/dist/client/react/index.d.mts +5 -4
- package/dist/client/react/react-store.d.mts +2 -1
- package/dist/client/session-atom.mjs +59 -46
- package/dist/client/session-refresh.d.mts +1 -0
- package/dist/client/solid/index.d.mts +5 -4
- package/dist/client/svelte/index.d.mts +5 -4
- package/dist/client/types.d.mts +2 -2
- package/dist/client/vanilla.d.mts +2 -1
- package/dist/client/vue/index.d.mts +5 -4
- package/dist/context/create-context.mjs +3 -3
- package/dist/context/helpers.mjs +2 -2
- package/dist/cookies/index.d.mts +7 -6
- package/dist/cookies/session-store.d.mts +0 -1
- package/dist/cookies/session-store.mjs +1 -2
- package/dist/crypto/index.d.mts +9 -2
- package/dist/crypto/jwt.d.mts +1 -0
- package/dist/crypto/password.d.mts +5 -1
- package/dist/db/adapter-base.d.mts +1 -0
- package/dist/db/adapter-kysely.d.mts +1 -0
- package/dist/db/field-converter.d.mts +1 -0
- package/dist/db/field.d.mts +10 -9
- package/dist/db/get-migration.d.mts +1 -0
- package/dist/db/get-schema.d.mts +1 -0
- package/dist/db/internal-adapter.d.mts +1 -0
- package/dist/db/internal-adapter.mjs +1 -2
- package/dist/db/revoke-unproven-account-access.d.mts +1 -0
- package/dist/db/schema.d.mts +2 -2
- package/dist/db/to-zod.d.mts +7 -3
- package/dist/db/with-hooks.d.mts +1 -0
- package/dist/index.d.mts +3 -4
- package/dist/integrations/next-js.d.mts +7 -4
- package/dist/integrations/node.d.mts +3 -2
- package/dist/integrations/svelte-kit.d.mts +9 -2
- package/dist/integrations/tanstack-start-solid.d.mts +5 -2
- package/dist/integrations/tanstack-start.d.mts +5 -2
- package/dist/oauth2/link-account.d.mts +1 -1
- package/dist/oauth2/state.d.mts +1 -0
- package/dist/oauth2/utils.d.mts +1 -0
- package/dist/package.mjs +1 -1
- package/dist/plugins/access/access.d.mts +1 -0
- package/dist/plugins/access/types.d.mts +5 -4
- package/dist/plugins/additional-fields/client.d.mts +1 -0
- package/dist/plugins/admin/access/statement.d.mts +0 -1
- package/dist/plugins/admin/admin.d.mts +137 -132
- package/dist/plugins/admin/client.d.mts +30 -30
- package/dist/plugins/admin/client.mjs +1 -1
- package/dist/plugins/admin/error-codes.d.mts +25 -23
- package/dist/plugins/admin/index.d.mts +1 -1
- package/dist/plugins/admin/schema.d.mts +1 -1
- package/dist/plugins/admin/types.d.mts +2 -3
- package/dist/plugins/anonymous/client.d.mts +11 -9
- package/dist/plugins/anonymous/client.mjs +1 -1
- package/dist/plugins/anonymous/error-codes.d.mts +10 -8
- package/dist/plugins/anonymous/index.d.mts +19 -15
- package/dist/plugins/anonymous/types.d.mts +1 -1
- package/dist/plugins/bearer/index.d.mts +8 -5
- package/dist/plugins/captcha/index.d.mts +8 -5
- package/dist/plugins/captcha/types.d.mts +1 -0
- package/dist/plugins/custom-session/client.d.mts +1 -0
- package/dist/plugins/custom-session/index.d.mts +12 -7
- package/dist/plugins/device-authorization/client.d.mts +1 -0
- package/dist/plugins/device-authorization/index.d.mts +22 -19
- package/dist/plugins/email-otp/client.d.mts +6 -4
- package/dist/plugins/email-otp/client.mjs +1 -1
- package/dist/plugins/email-otp/error-codes.d.mts +5 -3
- package/dist/plugins/email-otp/index.d.mts +76 -69
- package/dist/plugins/email-otp/types.d.mts +1 -0
- package/dist/plugins/generic-oauth/client.d.mts +11 -10
- package/dist/plugins/generic-oauth/client.mjs +1 -1
- package/dist/plugins/generic-oauth/error-codes.d.mts +10 -8
- package/dist/plugins/generic-oauth/index.d.mts +45 -41
- package/dist/plugins/generic-oauth/providers/auth0.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/gumroad.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/hubspot.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/index.d.mts +1 -2
- package/dist/plugins/generic-oauth/providers/keycloak.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/line.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/microsoft-entra-id.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/okta.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/patreon.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/slack.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/yandex.d.mts +1 -0
- package/dist/plugins/generic-oauth/types.d.mts +2 -1
- package/dist/plugins/haveibeenpwned/index.d.mts +6 -3
- package/dist/plugins/index.d.mts +1 -4
- package/dist/plugins/jwt/client.d.mts +2 -1
- package/dist/plugins/jwt/index.d.mts +12 -9
- package/dist/plugins/jwt/sign.d.mts +2 -2
- package/dist/plugins/jwt/types.d.mts +1 -1
- package/dist/plugins/jwt/utils.d.mts +4 -2
- package/dist/plugins/jwt/verify.d.mts +1 -0
- package/dist/plugins/last-login-method/index.d.mts +6 -3
- package/dist/plugins/magic-link/client.d.mts +1 -0
- package/dist/plugins/magic-link/index.d.mts +6 -4
- package/dist/plugins/mcp/client/adapters.d.mts +1 -0
- package/dist/plugins/mcp/client/index.mjs +2 -4
- package/dist/plugins/mcp/index.d.mts +12 -11
- package/dist/plugins/multi-session/client.d.mts +4 -2
- package/dist/plugins/multi-session/client.mjs +1 -1
- package/dist/plugins/multi-session/error-codes.d.mts +3 -1
- package/dist/plugins/multi-session/index.d.mts +12 -8
- package/dist/plugins/oauth-popup/client.d.mts +12 -6
- package/dist/plugins/oauth-popup/client.mjs +3 -5
- package/dist/plugins/oauth-popup/error-codes.d.mts +6 -4
- package/dist/plugins/oauth-popup/index.d.mts +12 -8
- package/dist/plugins/oauth-popup/index.mjs +1 -1
- package/dist/plugins/oauth-popup/types.d.mts +2 -1
- package/dist/plugins/oauth-proxy/index.d.mts +9 -6
- package/dist/plugins/oauth-proxy/index.mjs +2 -2
- package/dist/plugins/oidc-provider/client.d.mts +2 -1
- package/dist/plugins/oidc-provider/index.d.mts +20 -18
- package/dist/plugins/oidc-provider/schema.d.mts +1 -0
- package/dist/plugins/oidc-provider/types.d.mts +1 -1
- package/dist/plugins/one-tap/client.d.mts +3 -1
- package/dist/plugins/one-tap/index.d.mts +3 -1
- package/dist/plugins/one-time-token/client.d.mts +2 -1
- package/dist/plugins/one-time-token/index.d.mts +7 -6
- package/dist/plugins/open-api/generator.d.mts +1 -0
- package/dist/plugins/open-api/generator.mjs +5 -5
- package/dist/plugins/open-api/index.d.mts +5 -3
- package/dist/plugins/organization/access/statement.d.mts +0 -1
- package/dist/plugins/organization/adapter.d.mts +82 -56
- package/dist/plugins/organization/client.d.mts +103 -104
- package/dist/plugins/organization/client.mjs +4 -7
- package/dist/plugins/organization/error-codes.d.mts +61 -59
- package/dist/plugins/organization/has-permission.d.mts +1 -0
- package/dist/plugins/organization/has-permission.mjs +1 -1
- package/dist/plugins/organization/index.d.mts +1 -1
- package/dist/plugins/organization/organization.d.mts +33 -9
- package/dist/plugins/organization/organization.mjs +1 -1
- package/dist/plugins/organization/permission.d.mts +2 -2
- package/dist/plugins/organization/routes/crud-access-control.d.mts +147 -27
- package/dist/plugins/organization/routes/crud-invites.d.mts +186 -65
- package/dist/plugins/organization/routes/crud-invites.mjs +1 -1
- package/dist/plugins/organization/routes/crud-members.d.mts +178 -56
- package/dist/plugins/organization/routes/crud-members.mjs +1 -1
- package/dist/plugins/organization/routes/crud-org.d.mts +130 -57
- package/dist/plugins/organization/routes/crud-team.d.mts +235 -66
- package/dist/plugins/organization/schema.d.mts +4 -4
- package/dist/plugins/organization/schema.mjs +1 -1
- package/dist/plugins/organization/types.d.mts +14 -14
- package/dist/plugins/phone-number/client.d.mts +15 -13
- package/dist/plugins/phone-number/client.mjs +1 -1
- package/dist/plugins/phone-number/error-codes.d.mts +14 -12
- package/dist/plugins/phone-number/index.d.mts +47 -41
- package/dist/plugins/phone-number/types.d.mts +1 -1
- package/dist/plugins/siwe/client.d.mts +1 -0
- package/dist/plugins/siwe/index.d.mts +5 -4
- package/dist/plugins/test-utils/index.d.mts +4 -2
- package/dist/plugins/test-utils/types.d.mts +0 -1
- package/dist/plugins/two-factor/backup-codes/index.d.mts +7 -5
- package/dist/plugins/two-factor/backup-codes/index.mjs +1 -1
- package/dist/plugins/two-factor/client.d.mts +15 -12
- package/dist/plugins/two-factor/client.mjs +1 -1
- package/dist/plugins/two-factor/error-code.d.mts +12 -10
- package/dist/plugins/two-factor/index.d.mts +36 -32
- package/dist/plugins/two-factor/otp/index.d.mts +4 -2
- package/dist/plugins/two-factor/totp/index.d.mts +7 -5
- package/dist/plugins/two-factor/types.d.mts +1 -1
- package/dist/plugins/username/client.d.mts +11 -9
- package/dist/plugins/username/client.mjs +1 -1
- package/dist/plugins/username/error-codes.d.mts +10 -8
- package/dist/plugins/username/index.d.mts +22 -17
- package/dist/plugins/username/schema.d.mts +5 -3
- package/dist/state.d.mts +1 -0
- package/dist/test-utils/test-instance.d.mts +3 -5
- package/dist/types/adapter.d.mts +1 -1
- package/dist/types/api.d.mts +2 -1
- package/dist/types/auth.d.mts +1 -0
- package/dist/types/helper.d.mts +5 -5
- package/dist/types/index.d.mts +2 -2
- package/dist/types/models.d.mts +1 -0
- package/dist/types/plugins.d.mts +3 -2
- package/dist/utils/index.d.mts +1 -2
- package/dist/utils/url.d.mts +1 -0
- package/package.json +12 -11
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as _$better_call0 from "better-call";
|
|
2
|
+
|
|
1
3
|
//#region src/api/middlewares/authorization.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* Middleware that verifies the authenticated user owns a resource.
|
|
@@ -12,13 +14,9 @@
|
|
|
12
14
|
* so the handler can use it without a redundant DB query.
|
|
13
15
|
*/
|
|
14
16
|
declare function requireResourceOwnership(config: {
|
|
15
|
-
/** Database model name (e.g., "passkey", "apiKey") */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
idParam: string;
|
|
19
|
-
/** Where to find the ID: "body" or "query" */
|
|
20
|
-
idSource: "body" | "query";
|
|
21
|
-
/** Field on the resource that holds the owner's user ID. Default: "userId" */
|
|
17
|
+
/** Database model name (e.g., "passkey", "apiKey") */model: string; /** Request parameter name containing the resource ID */
|
|
18
|
+
idParam: string; /** Where to find the ID: "body" or "query" */
|
|
19
|
+
idSource: "body" | "query"; /** Field on the resource that holds the owner's user ID. Default: "userId" */
|
|
22
20
|
ownerField?: string;
|
|
23
21
|
/**
|
|
24
22
|
* Custom error to throw when the resource is not found.
|
|
@@ -43,9 +41,9 @@ declare function requireResourceOwnership(config: {
|
|
|
43
41
|
* @default "FORBIDDEN" (403)
|
|
44
42
|
*/
|
|
45
43
|
forbiddenStatus?: "FORBIDDEN" | "UNAUTHORIZED";
|
|
46
|
-
}): (inputContext:
|
|
44
|
+
}): _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
47
45
|
verifiedResource: {};
|
|
48
|
-
}
|
|
46
|
+
}>>;
|
|
49
47
|
/**
|
|
50
48
|
* Middleware that verifies the authenticated user is a member of a
|
|
51
49
|
* specific organization with one of the allowed roles.
|
|
@@ -57,17 +55,15 @@ declare function requireResourceOwnership(config: {
|
|
|
57
55
|
* The verified member is returned on `ctx.context.verifiedMember`.
|
|
58
56
|
*/
|
|
59
57
|
declare function requireOrgRole(config: {
|
|
60
|
-
/** Request parameter name containing the organization ID */
|
|
61
|
-
orgIdParam: string;
|
|
62
|
-
/** Where to find the org ID: "body" or "query" */
|
|
58
|
+
/** Request parameter name containing the organization ID */orgIdParam: string; /** Where to find the org ID: "body" or "query" */
|
|
63
59
|
orgIdSource: "body" | "query";
|
|
64
60
|
/**
|
|
65
61
|
* Roles that are authorized to proceed. If omitted or empty,
|
|
66
62
|
* any org membership is sufficient.
|
|
67
63
|
*/
|
|
68
64
|
allowedRoles?: string[];
|
|
69
|
-
}): (inputContext:
|
|
65
|
+
}): _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
70
66
|
verifiedMember: {};
|
|
71
|
-
}
|
|
67
|
+
}>>;
|
|
72
68
|
//#endregion
|
|
73
69
|
export { requireOrgRole, requireResourceOwnership };
|
|
@@ -69,8 +69,7 @@ function requireOrgRole(config) {
|
|
|
69
69
|
});
|
|
70
70
|
if (!member) throw new APIError("FORBIDDEN", { message: "Not a member of this organization" });
|
|
71
71
|
if (config.allowedRoles?.length) {
|
|
72
|
-
|
|
73
|
-
if (!parseMemberRoles(rawRole).some((role) => config.allowedRoles.includes(role))) throw new APIError("FORBIDDEN", { message: "Insufficient role for this operation" });
|
|
72
|
+
if (!parseMemberRoles(member.role ?? "").some((role) => config.allowedRoles.includes(role))) throw new APIError("FORBIDDEN", { message: "Insufficient role for this operation" });
|
|
74
73
|
}
|
|
75
74
|
return { verifiedMember: member };
|
|
76
75
|
});
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { requireOrgRole, requireResourceOwnership } from "./authorization.mjs";
|
|
2
|
-
import { formCsrfMiddleware, originCheck, originCheckMiddleware } from "./origin-check.mjs";
|
|
3
|
-
export { formCsrfMiddleware, originCheck, originCheckMiddleware, requireOrgRole, requireResourceOwnership };
|
|
2
|
+
import { formCsrfMiddleware, originCheck, originCheckMiddleware } from "./origin-check.mjs";
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { GenericEndpointContext } from "@better-auth/core";
|
|
2
|
+
import * as _$better_call0 from "better-call";
|
|
3
|
+
|
|
2
4
|
//#region src/api/middlewares/origin-check.d.ts
|
|
3
5
|
/**
|
|
4
6
|
* A middleware to validate callbackURL and origin against trustedOrigins.
|
|
5
7
|
* Also handles CSRF protection using Fetch Metadata for first-login scenarios.
|
|
6
8
|
*/
|
|
7
|
-
declare const originCheckMiddleware: (inputContext:
|
|
8
|
-
declare const originCheck: (getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext:
|
|
9
|
+
declare const originCheckMiddleware: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<void>>;
|
|
10
|
+
declare const originCheck: (getValue: (ctx: GenericEndpointContext) => string | string[]) => _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<void>>;
|
|
9
11
|
/**
|
|
10
12
|
* Middleware for CSRF protection using Fetch Metadata headers.
|
|
11
13
|
* This prevents cross-site navigation login attacks while supporting progressive enhancement.
|
|
12
14
|
*/
|
|
13
|
-
declare const formCsrfMiddleware: (inputContext:
|
|
15
|
+
declare const formCsrfMiddleware: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<void>>;
|
|
14
16
|
//#endregion
|
|
15
17
|
export { formCsrfMiddleware, originCheck, originCheckMiddleware };
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import * as _$_better_auth_core_oauth20 from "@better-auth/core/oauth2";
|
|
2
|
+
import * as _$better_call0 from "better-call";
|
|
1
3
|
import * as z from "zod";
|
|
4
|
+
|
|
2
5
|
//#region src/api/routes/account.d.ts
|
|
3
|
-
declare const listUserAccounts:
|
|
6
|
+
declare const listUserAccounts: _$better_call0.StrictEndpoint<"/list-accounts", {
|
|
4
7
|
method: "GET";
|
|
5
|
-
use: (
|
|
8
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
6
9
|
session: {
|
|
7
10
|
session: Record<string, any> & {
|
|
8
11
|
id: string;
|
|
@@ -24,7 +27,7 @@ declare const listUserAccounts: import("better-call").StrictEndpoint<"/list-acco
|
|
|
24
27
|
image?: string | null | undefined;
|
|
25
28
|
};
|
|
26
29
|
};
|
|
27
|
-
}
|
|
30
|
+
}>>[];
|
|
28
31
|
metadata: {
|
|
29
32
|
openapi: {
|
|
30
33
|
operationId: string;
|
|
@@ -84,7 +87,7 @@ declare const listUserAccounts: import("better-call").StrictEndpoint<"/list-acco
|
|
|
84
87
|
providerId: string;
|
|
85
88
|
accountId: string;
|
|
86
89
|
}[]>;
|
|
87
|
-
declare const linkSocialAccount:
|
|
90
|
+
declare const linkSocialAccount: _$better_call0.StrictEndpoint<"/link-social", {
|
|
88
91
|
method: "POST";
|
|
89
92
|
requireHeaders: true;
|
|
90
93
|
body: z.ZodObject<{
|
|
@@ -103,7 +106,7 @@ declare const linkSocialAccount: import("better-call").StrictEndpoint<"/link-soc
|
|
|
103
106
|
disableRedirect: z.ZodOptional<z.ZodBoolean>;
|
|
104
107
|
additionalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
105
108
|
}, z.core.$strip>;
|
|
106
|
-
use: (
|
|
109
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
107
110
|
session: {
|
|
108
111
|
session: Record<string, any> & {
|
|
109
112
|
id: string;
|
|
@@ -125,7 +128,7 @@ declare const linkSocialAccount: import("better-call").StrictEndpoint<"/link-soc
|
|
|
125
128
|
image?: string | null | undefined;
|
|
126
129
|
};
|
|
127
130
|
};
|
|
128
|
-
}
|
|
131
|
+
}>>[];
|
|
129
132
|
metadata: {
|
|
130
133
|
openapi: {
|
|
131
134
|
description: string;
|
|
@@ -162,13 +165,13 @@ declare const linkSocialAccount: import("better-call").StrictEndpoint<"/link-soc
|
|
|
162
165
|
url: string;
|
|
163
166
|
redirect: boolean;
|
|
164
167
|
}>;
|
|
165
|
-
declare const unlinkAccount:
|
|
168
|
+
declare const unlinkAccount: _$better_call0.StrictEndpoint<"/unlink-account", {
|
|
166
169
|
method: "POST";
|
|
167
170
|
body: z.ZodObject<{
|
|
168
171
|
providerId: z.ZodString;
|
|
169
172
|
accountId: z.ZodOptional<z.ZodString>;
|
|
170
173
|
}, z.core.$strip>;
|
|
171
|
-
use: (
|
|
174
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
172
175
|
session: {
|
|
173
176
|
session: Record<string, any> & {
|
|
174
177
|
id: string;
|
|
@@ -190,7 +193,7 @@ declare const unlinkAccount: import("better-call").StrictEndpoint<"/unlink-accou
|
|
|
190
193
|
image?: string | null | undefined;
|
|
191
194
|
};
|
|
192
195
|
};
|
|
193
|
-
}
|
|
196
|
+
}>>[];
|
|
194
197
|
metadata: {
|
|
195
198
|
openapi: {
|
|
196
199
|
description: string;
|
|
@@ -216,7 +219,7 @@ declare const unlinkAccount: import("better-call").StrictEndpoint<"/unlink-accou
|
|
|
216
219
|
}, {
|
|
217
220
|
status: boolean;
|
|
218
221
|
}>;
|
|
219
|
-
declare const getAccessToken:
|
|
222
|
+
declare const getAccessToken: _$better_call0.StrictEndpoint<"/get-access-token", {
|
|
220
223
|
method: "POST";
|
|
221
224
|
body: z.ZodObject<{
|
|
222
225
|
providerId: z.ZodString;
|
|
@@ -264,7 +267,7 @@ declare const getAccessToken: import("better-call").StrictEndpoint<"/get-access-
|
|
|
264
267
|
scopes: string[];
|
|
265
268
|
idToken: string | undefined;
|
|
266
269
|
}>;
|
|
267
|
-
declare const refreshToken:
|
|
270
|
+
declare const refreshToken: _$better_call0.StrictEndpoint<"/refresh-token", {
|
|
268
271
|
method: "POST";
|
|
269
272
|
body: z.ZodObject<{
|
|
270
273
|
providerId: z.ZodString;
|
|
@@ -323,7 +326,7 @@ declare const refreshToken: import("better-call").StrictEndpoint<"/refresh-token
|
|
|
323
326
|
providerId: string;
|
|
324
327
|
accountId: string;
|
|
325
328
|
}>;
|
|
326
|
-
declare const accountInfo:
|
|
329
|
+
declare const accountInfo: _$better_call0.StrictEndpoint<"/account-info", {
|
|
327
330
|
method: "GET";
|
|
328
331
|
metadata: {
|
|
329
332
|
openapi: {
|
|
@@ -378,7 +381,7 @@ declare const accountInfo: import("better-call").StrictEndpoint<"/account-info",
|
|
|
378
381
|
userId: z.ZodOptional<z.ZodString>;
|
|
379
382
|
}, z.core.$strip>>;
|
|
380
383
|
}, {
|
|
381
|
-
user:
|
|
384
|
+
user: _$_better_auth_core_oauth20.OAuth2UserInfo;
|
|
382
385
|
data: Record<string, any>;
|
|
383
386
|
} | null>;
|
|
384
387
|
//#endregion
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import * as _$better_call0 from "better-call";
|
|
1
2
|
import * as z from "zod";
|
|
3
|
+
|
|
2
4
|
//#region src/api/routes/callback.d.ts
|
|
3
|
-
declare const callbackOAuth:
|
|
5
|
+
declare const callbackOAuth: _$better_call0.StrictEndpoint<"/callback/:id", {
|
|
4
6
|
method: ("GET" | "POST")[];
|
|
5
7
|
operationId: string;
|
|
6
8
|
body: z.ZodOptional<z.ZodObject<{
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import { User } from "../../types/models.mjs";
|
|
2
|
-
import "../../types/index.mjs";
|
|
3
2
|
import { GenericEndpointContext } from "@better-auth/core";
|
|
3
|
+
import * as _$better_call0 from "better-call";
|
|
4
4
|
import * as z from "zod";
|
|
5
|
+
|
|
5
6
|
//#region src/api/routes/email-verification.d.ts
|
|
6
7
|
declare function createEmailVerificationToken(secret: string, email: string,
|
|
7
8
|
/**
|
|
8
9
|
* The email to update from
|
|
9
10
|
*/
|
|
11
|
+
|
|
10
12
|
updateTo?: string | undefined,
|
|
11
13
|
/**
|
|
12
14
|
* The time in seconds for the token to expire
|
|
13
15
|
*/
|
|
16
|
+
|
|
14
17
|
expiresIn?: number,
|
|
15
18
|
/**
|
|
16
19
|
* Extra payload to include in the token
|
|
17
20
|
*/
|
|
21
|
+
|
|
18
22
|
extraPayload?: Record<string, any>): Promise<string>;
|
|
19
23
|
/**
|
|
20
24
|
* A function to send a verification email to the user
|
|
21
25
|
*/
|
|
22
26
|
declare function sendVerificationEmailFn(ctx: GenericEndpointContext, user: User): Promise<void>;
|
|
23
|
-
declare const sendVerificationEmail:
|
|
27
|
+
declare const sendVerificationEmail: _$better_call0.StrictEndpoint<"/send-verification-email", {
|
|
24
28
|
method: "POST";
|
|
25
29
|
operationId: string;
|
|
26
30
|
cloneRequest: true;
|
|
@@ -96,14 +100,14 @@ declare const sendVerificationEmail: import("better-call").StrictEndpoint<"/send
|
|
|
96
100
|
}, {
|
|
97
101
|
status: boolean;
|
|
98
102
|
}>;
|
|
99
|
-
declare const verifyEmail:
|
|
103
|
+
declare const verifyEmail: _$better_call0.StrictEndpoint<"/verify-email", {
|
|
100
104
|
method: "GET";
|
|
101
105
|
operationId: string;
|
|
102
106
|
query: z.ZodObject<{
|
|
103
107
|
token: z.ZodString;
|
|
104
108
|
callbackURL: z.ZodOptional<z.ZodString>;
|
|
105
109
|
}, z.core.$strip>;
|
|
106
|
-
use: (
|
|
110
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<void>>[];
|
|
107
111
|
metadata: {
|
|
108
112
|
openapi: {
|
|
109
113
|
description: string;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import * as _$better_call0 from "better-call";
|
|
2
|
+
|
|
1
3
|
//#region src/api/routes/error.d.ts
|
|
2
|
-
declare const error:
|
|
4
|
+
declare const error: _$better_call0.StrictEndpoint<"/error", {
|
|
3
5
|
method: "GET";
|
|
4
6
|
metadata: {
|
|
5
7
|
openapi: {
|
|
@@ -9,5 +9,4 @@ import { signInEmail, signInSocial } from "./sign-in.mjs";
|
|
|
9
9
|
import { signOut } from "./sign-out.mjs";
|
|
10
10
|
import { signUpEmail } from "./sign-up.mjs";
|
|
11
11
|
import { updateSession } from "./update-session.mjs";
|
|
12
|
-
import { changeEmail, changePassword, deleteUser, deleteUserCallback, setPassword, updateUser } from "./update-user.mjs";
|
|
13
|
-
export { accountInfo, callbackOAuth, changeEmail, changePassword, createEmailVerificationToken, deleteUser, deleteUserCallback, error, freshSessionMiddleware, getAccessToken, getAuthoritativeSessionFromCtx, getSession, getSessionFromCtx, isStateful, linkSocialAccount, listSessions, listUserAccounts, ok, refreshToken, requestOnlySessionMiddleware, requestPasswordReset, requestPasswordResetCallback, resetPassword, revokeOtherSessions, revokeSession, revokeSessions, sendVerificationEmail, sendVerificationEmailFn, sensitiveSessionMiddleware, sessionMiddleware, setPassword, signInEmail, signInSocial, signOut, signUpEmail, unlinkAccount, updateSession, updateUser, verifyEmail, verifyPassword };
|
|
12
|
+
import { changeEmail, changePassword, deleteUser, deleteUserCallback, setPassword, updateUser } from "./update-user.mjs";
|
package/dist/api/routes/ok.d.mts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import * as _$better_call0 from "better-call";
|
|
1
2
|
import * as z from "zod";
|
|
3
|
+
|
|
2
4
|
//#region src/api/routes/password.d.ts
|
|
3
|
-
declare const requestPasswordReset:
|
|
5
|
+
declare const requestPasswordReset: _$better_call0.StrictEndpoint<"/request-password-reset", {
|
|
4
6
|
method: "POST";
|
|
5
7
|
body: z.ZodObject<{
|
|
6
8
|
email: z.ZodEmail;
|
|
@@ -32,18 +34,18 @@ declare const requestPasswordReset: import("better-call").StrictEndpoint<"/reque
|
|
|
32
34
|
};
|
|
33
35
|
};
|
|
34
36
|
};
|
|
35
|
-
use: (
|
|
37
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<void>>[];
|
|
36
38
|
}, {
|
|
37
39
|
status: boolean;
|
|
38
40
|
message: string;
|
|
39
41
|
}>;
|
|
40
|
-
declare const requestPasswordResetCallback:
|
|
42
|
+
declare const requestPasswordResetCallback: _$better_call0.StrictEndpoint<"/reset-password/:token", {
|
|
41
43
|
method: "GET";
|
|
42
44
|
operationId: string;
|
|
43
45
|
query: z.ZodObject<{
|
|
44
46
|
callbackURL: z.ZodString;
|
|
45
47
|
}, z.core.$strip>;
|
|
46
|
-
use: (
|
|
48
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<void>>[];
|
|
47
49
|
metadata: {
|
|
48
50
|
openapi: {
|
|
49
51
|
operationId: string;
|
|
@@ -85,7 +87,7 @@ declare const requestPasswordResetCallback: import("better-call").StrictEndpoint
|
|
|
85
87
|
};
|
|
86
88
|
};
|
|
87
89
|
}, never>;
|
|
88
|
-
declare const resetPassword:
|
|
90
|
+
declare const resetPassword: _$better_call0.StrictEndpoint<"/reset-password", {
|
|
89
91
|
method: "POST";
|
|
90
92
|
operationId: string;
|
|
91
93
|
query: z.ZodOptional<z.ZodObject<{
|
|
@@ -121,7 +123,7 @@ declare const resetPassword: import("better-call").StrictEndpoint<"/reset-passwo
|
|
|
121
123
|
}, {
|
|
122
124
|
status: boolean;
|
|
123
125
|
}>;
|
|
124
|
-
declare const verifyPassword:
|
|
126
|
+
declare const verifyPassword: _$better_call0.StrictEndpoint<"/verify-password", {
|
|
125
127
|
method: "POST";
|
|
126
128
|
body: z.ZodObject<{
|
|
127
129
|
password: z.ZodString;
|
|
@@ -150,7 +152,7 @@ declare const verifyPassword: import("better-call").StrictEndpoint<"/verify-pass
|
|
|
150
152
|
};
|
|
151
153
|
};
|
|
152
154
|
};
|
|
153
|
-
use: (
|
|
155
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
154
156
|
session: {
|
|
155
157
|
session: Record<string, any> & {
|
|
156
158
|
id: string;
|
|
@@ -172,7 +174,7 @@ declare const verifyPassword: import("better-call").StrictEndpoint<"/verify-pass
|
|
|
172
174
|
image?: string | null | undefined;
|
|
173
175
|
};
|
|
174
176
|
};
|
|
175
|
-
}
|
|
177
|
+
}>>[];
|
|
176
178
|
}, {
|
|
177
179
|
status: boolean;
|
|
178
180
|
}>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { Prettify } from "../../types/helper.mjs";
|
|
2
|
-
import { Session, User } from "../../types/models.mjs";
|
|
3
|
-
import "../../types/index.mjs";
|
|
1
|
+
import { Prettify as Prettify$1 } from "../../types/helper.mjs";
|
|
2
|
+
import { Session as Session$1, User as User$1 } from "../../types/models.mjs";
|
|
4
3
|
import { BetterAuthOptions, GenericEndpointContext } from "@better-auth/core";
|
|
4
|
+
import * as _$_better_auth_core_db0 from "@better-auth/core/db";
|
|
5
|
+
import * as _$better_call0 from "better-call";
|
|
5
6
|
import * as z from "zod";
|
|
7
|
+
|
|
6
8
|
//#region src/api/routes/session.d.ts
|
|
7
|
-
declare const getSession: <Option extends BetterAuthOptions>() =>
|
|
9
|
+
declare const getSession: <Option extends BetterAuthOptions>() => _$better_call0.StrictEndpoint<"/get-session", {
|
|
8
10
|
method: ("GET" | "POST")[];
|
|
9
11
|
operationId: string;
|
|
10
12
|
query: z.ZodOptional<z.ZodObject<{
|
|
@@ -40,8 +42,8 @@ declare const getSession: <Option extends BetterAuthOptions>() => import("better
|
|
|
40
42
|
};
|
|
41
43
|
};
|
|
42
44
|
}, {
|
|
43
|
-
session: Session<Option["session"], Option["plugins"]>;
|
|
44
|
-
user: User<Option["user"], Option["plugins"]>;
|
|
45
|
+
session: Session$1<Option["session"], Option["plugins"]>;
|
|
46
|
+
user: User$1<Option["user"], Option["plugins"]>;
|
|
45
47
|
} | null>;
|
|
46
48
|
/**
|
|
47
49
|
* Whether the deployment keeps sessions in a durable server-side store
|
|
@@ -58,8 +60,8 @@ declare const getSessionFromCtx: <U extends Record<string, any> = Record<string,
|
|
|
58
60
|
disableCookieCache?: boolean;
|
|
59
61
|
disableRefresh?: boolean;
|
|
60
62
|
} | undefined) => Promise<{
|
|
61
|
-
session: S & Session;
|
|
62
|
-
user: U & User;
|
|
63
|
+
session: S & Session$1;
|
|
64
|
+
user: U & User$1;
|
|
63
65
|
} | null>;
|
|
64
66
|
/**
|
|
65
67
|
* Reads the session from the source that can authorize sensitive work.
|
|
@@ -92,7 +94,7 @@ declare const getAuthoritativeSessionFromCtx: <U extends Record<string, any> = R
|
|
|
92
94
|
/**
|
|
93
95
|
* The middleware forces the endpoint to require a valid session.
|
|
94
96
|
*/
|
|
95
|
-
declare const sessionMiddleware: (inputContext:
|
|
97
|
+
declare const sessionMiddleware: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
96
98
|
session: {
|
|
97
99
|
session: Record<string, any> & {
|
|
98
100
|
id: string;
|
|
@@ -114,12 +116,12 @@ declare const sessionMiddleware: (inputContext: import("better-call").Middleware
|
|
|
114
116
|
image?: string | null | undefined;
|
|
115
117
|
};
|
|
116
118
|
};
|
|
117
|
-
}
|
|
119
|
+
}>>;
|
|
118
120
|
/**
|
|
119
121
|
* This middleware forces the endpoint to require a valid authoritative session.
|
|
120
122
|
* This should be used for sensitive operations like password changes, account deletion, etc.
|
|
121
123
|
*/
|
|
122
|
-
declare const sensitiveSessionMiddleware: (inputContext:
|
|
124
|
+
declare const sensitiveSessionMiddleware: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
123
125
|
session: {
|
|
124
126
|
session: Record<string, any> & {
|
|
125
127
|
id: string;
|
|
@@ -141,12 +143,12 @@ declare const sensitiveSessionMiddleware: (inputContext: import("better-call").M
|
|
|
141
143
|
image?: string | null | undefined;
|
|
142
144
|
};
|
|
143
145
|
};
|
|
144
|
-
}
|
|
146
|
+
}>>;
|
|
145
147
|
/**
|
|
146
148
|
* This middleware allows you to call the endpoint on the client if session is valid.
|
|
147
149
|
* However, if called on the server, no session is required.
|
|
148
150
|
*/
|
|
149
|
-
declare const requestOnlySessionMiddleware: (inputContext:
|
|
151
|
+
declare const requestOnlySessionMiddleware: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
150
152
|
session: {
|
|
151
153
|
session: Record<string, any> & {
|
|
152
154
|
id: string;
|
|
@@ -168,7 +170,7 @@ declare const requestOnlySessionMiddleware: (inputContext: import("better-call")
|
|
|
168
170
|
image?: string | null | undefined;
|
|
169
171
|
};
|
|
170
172
|
} | null;
|
|
171
|
-
}
|
|
173
|
+
}>>;
|
|
172
174
|
/**
|
|
173
175
|
* This middleware forces the endpoint to require a valid session,
|
|
174
176
|
* as well as making sure the session is fresh before proceeding.
|
|
@@ -176,7 +178,7 @@ declare const requestOnlySessionMiddleware: (inputContext: import("better-call")
|
|
|
176
178
|
* Session freshness check will be skipped if the session config's freshAge
|
|
177
179
|
* is set to 0
|
|
178
180
|
*/
|
|
179
|
-
declare const freshSessionMiddleware: (inputContext:
|
|
181
|
+
declare const freshSessionMiddleware: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
180
182
|
session: {
|
|
181
183
|
session: Record<string, any> & {
|
|
182
184
|
id: string;
|
|
@@ -198,14 +200,14 @@ declare const freshSessionMiddleware: (inputContext: import("better-call").Middl
|
|
|
198
200
|
image?: string | null | undefined;
|
|
199
201
|
};
|
|
200
202
|
};
|
|
201
|
-
}
|
|
203
|
+
}>>;
|
|
202
204
|
/**
|
|
203
205
|
* user active sessions list
|
|
204
206
|
*/
|
|
205
|
-
declare const listSessions: <Option extends BetterAuthOptions>() =>
|
|
207
|
+
declare const listSessions: <Option extends BetterAuthOptions>() => _$better_call0.StrictEndpoint<"/list-sessions", {
|
|
206
208
|
method: "GET";
|
|
207
209
|
operationId: string;
|
|
208
|
-
use: (
|
|
210
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
209
211
|
session: {
|
|
210
212
|
session: Record<string, any> & {
|
|
211
213
|
id: string;
|
|
@@ -227,7 +229,7 @@ declare const listSessions: <Option extends BetterAuthOptions>() => import("bett
|
|
|
227
229
|
image?: string | null | undefined;
|
|
228
230
|
};
|
|
229
231
|
};
|
|
230
|
-
}
|
|
232
|
+
}>>[];
|
|
231
233
|
requireHeaders: true;
|
|
232
234
|
metadata: {
|
|
233
235
|
openapi: {
|
|
@@ -250,7 +252,7 @@ declare const listSessions: <Option extends BetterAuthOptions>() => import("bett
|
|
|
250
252
|
};
|
|
251
253
|
};
|
|
252
254
|
};
|
|
253
|
-
}, Prettify<{
|
|
255
|
+
}, Prettify$1<{
|
|
254
256
|
id: string;
|
|
255
257
|
createdAt: Date;
|
|
256
258
|
updatedAt: Date;
|
|
@@ -259,16 +261,16 @@ declare const listSessions: <Option extends BetterAuthOptions>() => import("bett
|
|
|
259
261
|
token: string;
|
|
260
262
|
ipAddress?: string | null | undefined;
|
|
261
263
|
userAgent?: string | null | undefined;
|
|
262
|
-
} &
|
|
264
|
+
} & _$_better_auth_core_db0.InferDBFieldsFromOptions<Option["session"]> & _$_better_auth_core_db0.InferDBFieldsFromPlugins<"session", Option["plugins"]> extends infer T ? { [K in keyof T]: T[K] } : never>[]>;
|
|
263
265
|
/**
|
|
264
266
|
* revoke a single session
|
|
265
267
|
*/
|
|
266
|
-
declare const revokeSession:
|
|
268
|
+
declare const revokeSession: _$better_call0.StrictEndpoint<"/revoke-session", {
|
|
267
269
|
method: "POST";
|
|
268
270
|
body: z.ZodObject<{
|
|
269
271
|
token: z.ZodString;
|
|
270
272
|
}, z.core.$strip>;
|
|
271
|
-
use: (
|
|
273
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
272
274
|
session: {
|
|
273
275
|
session: Record<string, any> & {
|
|
274
276
|
id: string;
|
|
@@ -290,7 +292,7 @@ declare const revokeSession: import("better-call").StrictEndpoint<"/revoke-sessi
|
|
|
290
292
|
image?: string | null | undefined;
|
|
291
293
|
};
|
|
292
294
|
};
|
|
293
|
-
}
|
|
295
|
+
}>>[];
|
|
294
296
|
requireHeaders: true;
|
|
295
297
|
metadata: {
|
|
296
298
|
openapi: {
|
|
@@ -338,9 +340,9 @@ declare const revokeSession: import("better-call").StrictEndpoint<"/revoke-sessi
|
|
|
338
340
|
/**
|
|
339
341
|
* revoke all user sessions
|
|
340
342
|
*/
|
|
341
|
-
declare const revokeSessions:
|
|
343
|
+
declare const revokeSessions: _$better_call0.StrictEndpoint<"/revoke-sessions", {
|
|
342
344
|
method: "POST";
|
|
343
|
-
use: (
|
|
345
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
344
346
|
session: {
|
|
345
347
|
session: Record<string, any> & {
|
|
346
348
|
id: string;
|
|
@@ -362,7 +364,7 @@ declare const revokeSessions: import("better-call").StrictEndpoint<"/revoke-sess
|
|
|
362
364
|
image?: string | null | undefined;
|
|
363
365
|
};
|
|
364
366
|
};
|
|
365
|
-
}
|
|
367
|
+
}>>[];
|
|
366
368
|
requireHeaders: true;
|
|
367
369
|
metadata: {
|
|
368
370
|
openapi: {
|
|
@@ -391,10 +393,10 @@ declare const revokeSessions: import("better-call").StrictEndpoint<"/revoke-sess
|
|
|
391
393
|
}, {
|
|
392
394
|
status: boolean;
|
|
393
395
|
}>;
|
|
394
|
-
declare const revokeOtherSessions:
|
|
396
|
+
declare const revokeOtherSessions: _$better_call0.StrictEndpoint<"/revoke-other-sessions", {
|
|
395
397
|
method: "POST";
|
|
396
398
|
requireHeaders: true;
|
|
397
|
-
use: (
|
|
399
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
398
400
|
session: {
|
|
399
401
|
session: Record<string, any> & {
|
|
400
402
|
id: string;
|
|
@@ -416,7 +418,7 @@ declare const revokeOtherSessions: import("better-call").StrictEndpoint<"/revoke
|
|
|
416
418
|
image?: string | null | undefined;
|
|
417
419
|
};
|
|
418
420
|
};
|
|
419
|
-
}
|
|
421
|
+
}>>[];
|
|
420
422
|
metadata: {
|
|
421
423
|
openapi: {
|
|
422
424
|
description: string;
|
|
@@ -295,9 +295,8 @@ const getSessionFromCtx = async (ctx, config) => {
|
|
|
295
295
|
if (session.headers) session.headers.forEach((value, key) => {
|
|
296
296
|
const lowerKey = key.toLowerCase();
|
|
297
297
|
if (lowerKey === "cache-control" || lowerKey === "pragma") return;
|
|
298
|
-
if (
|
|
299
|
-
else
|
|
300
|
-
else ctx.context.responseHeaders.set(key, value);
|
|
298
|
+
if (lowerKey === "set-cookie") ctx.responseHeaders.append(key, value);
|
|
299
|
+
else ctx.responseHeaders.set(key, value);
|
|
301
300
|
});
|
|
302
301
|
ctx.context.session = session.response;
|
|
303
302
|
return session.response;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BetterAuthOptions } from "@better-auth/core";
|
|
2
2
|
import { User } from "@better-auth/core/db";
|
|
3
|
+
import * as _$better_call0 from "better-call";
|
|
3
4
|
import * as z from "zod";
|
|
5
|
+
|
|
4
6
|
//#region src/api/routes/sign-in.d.ts
|
|
5
7
|
declare const socialSignInBodySchema: z.ZodObject<{
|
|
6
8
|
callbackURL: z.ZodOptional<z.ZodString>;
|
|
@@ -27,7 +29,7 @@ declare const socialSignInBodySchema: z.ZodObject<{
|
|
|
27
29
|
loginHint: z.ZodOptional<z.ZodString>;
|
|
28
30
|
additionalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
29
31
|
}, z.core.$strip>;
|
|
30
|
-
declare const signInSocial: <O extends BetterAuthOptions>() =>
|
|
32
|
+
declare const signInSocial: <O extends BetterAuthOptions>() => _$better_call0.StrictEndpoint<"/sign-in/social", {
|
|
31
33
|
method: "POST";
|
|
32
34
|
operationId: string;
|
|
33
35
|
body: z.ZodObject<{
|
|
@@ -108,10 +110,10 @@ declare const signInSocial: <O extends BetterAuthOptions>() => import("better-ca
|
|
|
108
110
|
url: undefined;
|
|
109
111
|
user: User<O["user"], O["plugins"]>;
|
|
110
112
|
}>;
|
|
111
|
-
declare const signInEmail: <O extends BetterAuthOptions>() =>
|
|
113
|
+
declare const signInEmail: <O extends BetterAuthOptions>() => _$better_call0.StrictEndpoint<"/sign-in/email", {
|
|
112
114
|
method: "POST";
|
|
113
115
|
operationId: string;
|
|
114
|
-
use: (
|
|
116
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<void>>[];
|
|
115
117
|
cloneRequest: true;
|
|
116
118
|
body: z.ZodObject<{
|
|
117
119
|
email: z.ZodString;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import * as _$better_call0 from "better-call";
|
|
2
|
+
|
|
1
3
|
//#region src/api/routes/sign-out.d.ts
|
|
2
|
-
declare const signOut:
|
|
4
|
+
declare const signOut: _$better_call0.StrictEndpoint<"/sign-out", {
|
|
3
5
|
method: "POST";
|
|
4
6
|
operationId: string;
|
|
5
7
|
requireHeaders: true;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { AdditionalUserFieldsInput, User } from "../../types/models.mjs";
|
|
2
|
-
import "../../types/index.mjs";
|
|
3
2
|
import { BetterAuthOptions } from "@better-auth/core";
|
|
3
|
+
import * as _$better_call0 from "better-call";
|
|
4
4
|
import * as z from "zod";
|
|
5
|
+
|
|
5
6
|
//#region src/api/routes/sign-up.d.ts
|
|
6
|
-
declare const signUpEmail: <O extends BetterAuthOptions>() =>
|
|
7
|
+
declare const signUpEmail: <O extends BetterAuthOptions>() => _$better_call0.StrictEndpoint<"/sign-up/email", {
|
|
7
8
|
method: "POST";
|
|
8
9
|
operationId: string;
|
|
9
|
-
use: (
|
|
10
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<void>>[];
|
|
10
11
|
body: z.ZodIntersection<z.ZodObject<{
|
|
11
12
|
name: z.ZodString;
|
|
12
13
|
email: z.ZodEmail;
|