better-auth 1.6.22 → 1.6.24
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 +1 -6
- package/dist/api/dispatch.d.mts +0 -1
- package/dist/api/index.d.mts +476 -478
- package/dist/api/middlewares/authorization.d.mts +12 -8
- package/dist/api/middlewares/authorization.mjs +2 -1
- package/dist/api/middlewares/index.d.mts +2 -1
- package/dist/api/middlewares/origin-check.d.mts +3 -5
- package/dist/api/routes/account.d.mts +10 -13
- package/dist/api/routes/account.mjs +35 -7
- package/dist/api/routes/callback.d.mts +1 -3
- package/dist/api/routes/callback.mjs +4 -0
- package/dist/api/routes/email-verification.d.mts +4 -8
- package/dist/api/routes/email-verification.mjs +15 -2
- package/dist/api/routes/error.d.mts +1 -3
- package/dist/api/routes/index.d.mts +2 -1
- package/dist/api/routes/ok.d.mts +1 -3
- package/dist/api/routes/password.d.mts +7 -9
- package/dist/api/routes/password.mjs +14 -1
- package/dist/api/routes/session.d.mts +22 -24
- package/dist/api/routes/session.mjs +5 -1
- package/dist/api/routes/sign-in.d.mts +3 -5
- package/dist/api/routes/sign-in.mjs +84 -2
- package/dist/api/routes/sign-out.d.mts +1 -3
- package/dist/api/routes/sign-up.d.mts +3 -4
- package/dist/api/routes/sign-up.mjs +3 -2
- package/dist/api/routes/update-session.d.mts +3 -4
- package/dist/api/routes/update-user.d.mts +13 -14
- package/dist/api/routes/update-user.mjs +26 -1
- package/dist/auth/full.d.mts +1 -1
- package/dist/auth/minimal.d.mts +1 -1
- package/dist/client/config.d.mts +12 -14
- package/dist/client/config.mjs +2 -2
- package/dist/client/equality.d.mts +0 -1
- package/dist/client/index.d.mts +6 -5
- package/dist/client/lynx/index.d.mts +4 -5
- package/dist/client/lynx/lynx-store.d.mts +1 -2
- package/dist/client/parser.d.mts +7 -3
- package/dist/client/path-to-object.d.mts +3 -4
- package/dist/client/plugins/index.d.mts +2 -1
- package/dist/client/plugins/infer-plugin.d.mts +0 -1
- package/dist/client/query.d.mts +0 -1
- package/dist/client/query.mjs +38 -20
- package/dist/client/react/index.d.mts +4 -5
- package/dist/client/react/react-store.d.mts +1 -2
- package/dist/client/session-refresh.d.mts +0 -1
- package/dist/client/solid/index.d.mts +5 -6
- package/dist/client/svelte/index.d.mts +5 -6
- package/dist/client/types.d.mts +2 -2
- package/dist/client/vanilla.d.mts +2 -3
- package/dist/client/vue/index.d.mts +5 -6
- package/dist/context/create-context.mjs +3 -3
- package/dist/context/helpers.mjs +2 -2
- package/dist/cookies/cookie-utils.d.mts +1 -1
- package/dist/cookies/index.d.mts +6 -7
- package/dist/cookies/index.mjs +4 -0
- package/dist/cookies/session-store.d.mts +1 -0
- package/dist/cookies/session-store.mjs +6 -1
- package/dist/crypto/index.d.mts +2 -9
- package/dist/crypto/jwt.d.mts +0 -1
- package/dist/crypto/password.d.mts +1 -5
- package/dist/db/adapter-base.d.mts +0 -1
- package/dist/db/adapter-kysely.d.mts +0 -1
- package/dist/db/field-converter.d.mts +0 -1
- package/dist/db/field.d.mts +9 -10
- package/dist/db/get-migration.d.mts +0 -1
- package/dist/db/get-migration.mjs +8 -4
- package/dist/db/get-schema.d.mts +0 -1
- package/dist/db/internal-adapter.d.mts +0 -1
- package/dist/db/internal-adapter.mjs +61 -1
- package/dist/db/revoke-unproven-account-access.d.mts +0 -1
- package/dist/db/schema.d.mts +2 -2
- package/dist/db/to-zod.d.mts +3 -7
- package/dist/db/with-hooks.d.mts +0 -1
- package/dist/index.d.mts +4 -3
- package/dist/integrations/next-js.d.mts +4 -7
- package/dist/integrations/node.d.mts +2 -3
- package/dist/integrations/svelte-kit.d.mts +2 -9
- package/dist/integrations/tanstack-start-solid.d.mts +2 -5
- package/dist/integrations/tanstack-start.d.mts +2 -5
- package/dist/oauth2/link-account.d.mts +1 -1
- package/dist/oauth2/state.d.mts +0 -1
- package/dist/oauth2/utils.d.mts +0 -1
- package/dist/package.mjs +1 -1
- package/dist/plugins/access/access.d.mts +0 -1
- package/dist/plugins/access/types.d.mts +4 -5
- package/dist/plugins/additional-fields/client.d.mts +0 -1
- package/dist/plugins/admin/access/statement.d.mts +1 -0
- package/dist/plugins/admin/admin.d.mts +120 -125
- 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 +23 -25
- package/dist/plugins/admin/index.d.mts +1 -1
- package/dist/plugins/admin/routes.mjs +9 -0
- package/dist/plugins/admin/schema.d.mts +1 -1
- package/dist/plugins/admin/types.d.mts +3 -2
- package/dist/plugins/anonymous/client.d.mts +9 -11
- package/dist/plugins/anonymous/client.mjs +1 -1
- package/dist/plugins/anonymous/error-codes.d.mts +8 -10
- package/dist/plugins/anonymous/index.d.mts +14 -18
- package/dist/plugins/anonymous/types.d.mts +1 -1
- package/dist/plugins/bearer/index.d.mts +4 -7
- package/dist/plugins/captcha/index.d.mts +5 -8
- package/dist/plugins/captcha/types.d.mts +0 -1
- package/dist/plugins/custom-session/client.d.mts +0 -1
- package/dist/plugins/custom-session/index.d.mts +7 -12
- package/dist/plugins/device-authorization/client.d.mts +0 -1
- package/dist/plugins/device-authorization/index.d.mts +19 -22
- package/dist/plugins/email-otp/client.d.mts +4 -6
- package/dist/plugins/email-otp/client.mjs +1 -1
- package/dist/plugins/email-otp/error-codes.d.mts +3 -5
- package/dist/plugins/email-otp/index.d.mts +67 -73
- package/dist/plugins/email-otp/routes.mjs +2 -0
- package/dist/plugins/email-otp/types.d.mts +0 -1
- package/dist/plugins/generic-oauth/client.d.mts +11 -11
- package/dist/plugins/generic-oauth/client.mjs +1 -1
- package/dist/plugins/generic-oauth/error-codes.d.mts +8 -10
- package/dist/plugins/generic-oauth/index.d.mts +41 -44
- package/dist/plugins/generic-oauth/index.mjs +2 -1
- package/dist/plugins/generic-oauth/providers/auth0.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/gumroad.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/hubspot.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/index.d.mts +3 -1
- package/dist/plugins/generic-oauth/providers/keycloak.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/line.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/microsoft-entra-id.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/okta.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/patreon.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/slack.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/yandex.d.mts +28 -0
- package/dist/plugins/generic-oauth/providers/yandex.mjs +60 -0
- package/dist/plugins/generic-oauth/routes.mjs +14 -0
- package/dist/plugins/generic-oauth/types.d.mts +1 -2
- package/dist/plugins/haveibeenpwned/index.d.mts +3 -6
- package/dist/plugins/index.d.mts +5 -1
- package/dist/plugins/index.mjs +2 -1
- package/dist/plugins/jwt/client.d.mts +2 -4
- package/dist/plugins/jwt/index.d.mts +8 -11
- 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 +2 -4
- package/dist/plugins/jwt/verify.d.mts +0 -1
- package/dist/plugins/last-login-method/client.mjs +13 -0
- package/dist/plugins/last-login-method/index.d.mts +11 -5
- package/dist/plugins/last-login-method/index.mjs +8 -0
- package/dist/plugins/magic-link/client.d.mts +0 -1
- package/dist/plugins/magic-link/index.d.mts +4 -5
- package/dist/plugins/magic-link/index.mjs +32 -1
- package/dist/plugins/mcp/authorize.mjs +12 -0
- package/dist/plugins/mcp/client/adapters.d.mts +0 -1
- package/dist/plugins/mcp/client/index.d.mts +2 -0
- package/dist/plugins/mcp/client/index.mjs +36 -11
- package/dist/plugins/mcp/index.d.mts +10 -11
- package/dist/plugins/multi-session/client.d.mts +2 -4
- package/dist/plugins/multi-session/client.mjs +1 -1
- package/dist/plugins/multi-session/error-codes.d.mts +1 -3
- package/dist/plugins/multi-session/index.d.mts +7 -11
- package/dist/plugins/multi-session/index.mjs +45 -0
- package/dist/plugins/oauth-popup/client.d.mts +6 -12
- package/dist/plugins/oauth-popup/client.mjs +5 -3
- package/dist/plugins/oauth-popup/error-codes.d.mts +4 -6
- package/dist/plugins/oauth-popup/index.d.mts +8 -12
- package/dist/plugins/oauth-popup/index.mjs +1 -1
- package/dist/plugins/oauth-popup/types.d.mts +1 -2
- package/dist/plugins/oauth-proxy/index.d.mts +6 -9
- package/dist/plugins/oauth-proxy/index.mjs +2 -2
- package/dist/plugins/oidc-provider/authorize.mjs +9 -0
- package/dist/plugins/oidc-provider/client.d.mts +1 -2
- package/dist/plugins/oidc-provider/index.d.mts +15 -17
- package/dist/plugins/oidc-provider/index.mjs +26 -2
- package/dist/plugins/oidc-provider/schema.d.mts +0 -1
- package/dist/plugins/oidc-provider/schema.mjs +37 -0
- package/dist/plugins/oidc-provider/types.d.mts +1 -1
- package/dist/plugins/one-tap/client.d.mts +3 -6
- package/dist/plugins/one-tap/client.mjs +3 -0
- package/dist/plugins/one-tap/index.d.mts +1 -3
- package/dist/plugins/one-tap/index.mjs +5 -0
- package/dist/plugins/one-time-token/client.d.mts +1 -2
- package/dist/plugins/one-time-token/index.d.mts +5 -6
- package/dist/plugins/one-time-token/index.mjs +30 -0
- package/dist/plugins/open-api/generator.d.mts +0 -1
- package/dist/plugins/open-api/generator.mjs +81 -5
- package/dist/plugins/open-api/index.d.mts +3 -5
- package/dist/plugins/organization/access/statement.d.mts +1 -0
- package/dist/plugins/organization/adapter.d.mts +56 -82
- package/dist/plugins/organization/adapter.mjs +17 -3
- package/dist/plugins/organization/client.d.mts +106 -105
- package/dist/plugins/organization/client.mjs +7 -4
- package/dist/plugins/organization/error-codes.d.mts +59 -61
- package/dist/plugins/organization/has-permission.d.mts +0 -1
- 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 +7 -7
- package/dist/plugins/organization/organization.mjs +434 -1
- package/dist/plugins/organization/permission.d.mts +2 -2
- package/dist/plugins/organization/routes/crud-access-control.d.mts +17 -17
- package/dist/plugins/organization/routes/crud-invites.d.mts +53 -54
- package/dist/plugins/organization/routes/crud-invites.mjs +1 -1
- package/dist/plugins/organization/routes/crud-members.d.mts +44 -46
- package/dist/plugins/organization/routes/crud-members.mjs +4 -1
- package/dist/plugins/organization/routes/crud-org.d.mts +47 -48
- package/dist/plugins/organization/routes/crud-org.mjs +2 -2
- package/dist/plugins/organization/routes/crud-team.d.mts +50 -51
- package/dist/plugins/organization/schema.d.mts +4 -4
- package/dist/plugins/organization/schema.mjs +1 -1
- package/dist/plugins/organization/types.d.mts +16 -16
- package/dist/plugins/phone-number/client.d.mts +13 -15
- package/dist/plugins/phone-number/client.mjs +1 -1
- package/dist/plugins/phone-number/error-codes.d.mts +12 -14
- package/dist/plugins/phone-number/index.d.mts +41 -47
- package/dist/plugins/phone-number/routes.mjs +15 -0
- package/dist/plugins/phone-number/types.d.mts +1 -1
- package/dist/plugins/siwe/client.d.mts +0 -1
- package/dist/plugins/siwe/index.d.mts +4 -5
- package/dist/plugins/test-utils/index.d.mts +2 -4
- package/dist/plugins/test-utils/types.d.mts +1 -0
- package/dist/plugins/two-factor/backup-codes/index.d.mts +4 -6
- package/dist/plugins/two-factor/backup-codes/index.mjs +52 -1
- package/dist/plugins/two-factor/client.d.mts +12 -15
- package/dist/plugins/two-factor/client.mjs +1 -1
- package/dist/plugins/two-factor/error-code.d.mts +10 -12
- package/dist/plugins/two-factor/index.d.mts +27 -31
- package/dist/plugins/two-factor/index.mjs +30 -0
- package/dist/plugins/two-factor/otp/index.d.mts +2 -4
- package/dist/plugins/two-factor/otp/index.mjs +42 -1
- package/dist/plugins/two-factor/totp/index.d.mts +4 -6
- package/dist/plugins/two-factor/totp/index.mjs +47 -0
- package/dist/plugins/two-factor/types.d.mts +1 -1
- package/dist/plugins/username/client.d.mts +9 -11
- package/dist/plugins/username/client.mjs +1 -1
- package/dist/plugins/username/error-codes.d.mts +8 -10
- package/dist/plugins/username/index.d.mts +17 -22
- package/dist/plugins/username/schema.d.mts +3 -5
- package/dist/state.d.mts +0 -1
- package/dist/state.mjs +4 -0
- package/dist/test-utils/test-instance.d.mts +5 -3
- package/dist/test-utils/test-instance.mjs +4 -1
- package/dist/types/adapter.d.mts +1 -1
- package/dist/types/api.d.mts +1 -2
- package/dist/types/auth.d.mts +0 -1
- package/dist/types/helper.d.mts +5 -5
- package/dist/types/index.d.mts +2 -2
- package/dist/types/models.d.mts +0 -1
- package/dist/types/plugins.d.mts +2 -3
- package/dist/utils/index.d.mts +2 -1
- package/dist/utils/request.mjs +23 -0
- package/dist/utils/url.d.mts +0 -1
- package/package.json +10 -10
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { EmailOTPOptions } from "./types.mjs";
|
|
2
|
-
import * as _better_auth_core0 from "@better-auth/core";
|
|
3
|
-
import * as _better_auth_core_db0 from "@better-auth/core/db";
|
|
4
|
-
import * as _better_auth_core_utils_error_codes0 from "@better-auth/core/utils/error-codes";
|
|
5
|
-
import * as better_call0 from "better-call";
|
|
6
|
-
import * as zod from "zod";
|
|
7
|
-
import * as zod_v4_core0 from "zod/v4/core";
|
|
8
|
-
|
|
9
2
|
//#region src/plugins/email-otp/index.d.ts
|
|
10
3
|
declare module "@better-auth/core" {
|
|
11
4
|
interface BetterAuthPluginRegistry<AuthOptions, Options> {
|
|
@@ -17,11 +10,11 @@ declare module "@better-auth/core" {
|
|
|
17
10
|
declare const emailOTP: (options: EmailOTPOptions) => {
|
|
18
11
|
id: "email-otp";
|
|
19
12
|
version: string;
|
|
20
|
-
init(ctx:
|
|
13
|
+
init(ctx: import("@better-auth/core").AuthContext): {
|
|
21
14
|
options: {
|
|
22
15
|
emailVerification: {
|
|
23
16
|
sendVerificationEmail(data: {
|
|
24
|
-
user:
|
|
17
|
+
user: import("@better-auth/core/db").User;
|
|
25
18
|
url: string;
|
|
26
19
|
token: string;
|
|
27
20
|
}, request: Request | undefined): Promise<void>;
|
|
@@ -29,17 +22,18 @@ declare const emailOTP: (options: EmailOTPOptions) => {
|
|
|
29
22
|
};
|
|
30
23
|
} | undefined;
|
|
31
24
|
endpoints: {
|
|
32
|
-
sendVerificationOTP:
|
|
25
|
+
sendVerificationOTP: import("better-call").StrictEndpoint<"/email-otp/send-verification-otp", {
|
|
33
26
|
method: "POST";
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>)[];
|
|
28
|
+
body: import("zod").ZodObject<{
|
|
29
|
+
email: import("zod").ZodString;
|
|
30
|
+
type: import("zod").ZodEnum<{
|
|
37
31
|
"sign-in": "sign-in";
|
|
38
32
|
"change-email": "change-email";
|
|
39
33
|
"email-verification": "email-verification";
|
|
40
34
|
"forget-password": "forget-password";
|
|
41
35
|
}>;
|
|
42
|
-
},
|
|
36
|
+
}, import("zod/v4/core").$strip>;
|
|
43
37
|
metadata: {
|
|
44
38
|
openapi: {
|
|
45
39
|
operationId: string;
|
|
@@ -66,17 +60,17 @@ declare const emailOTP: (options: EmailOTPOptions) => {
|
|
|
66
60
|
}, {
|
|
67
61
|
success: boolean;
|
|
68
62
|
}>;
|
|
69
|
-
createVerificationOTP:
|
|
63
|
+
createVerificationOTP: import("better-call").StrictEndpoint<string, {
|
|
70
64
|
method: "POST";
|
|
71
|
-
body: zod.ZodObject<{
|
|
72
|
-
email: zod.ZodString;
|
|
73
|
-
type: zod.ZodEnum<{
|
|
65
|
+
body: import("zod").ZodObject<{
|
|
66
|
+
email: import("zod").ZodString;
|
|
67
|
+
type: import("zod").ZodEnum<{
|
|
74
68
|
"sign-in": "sign-in";
|
|
75
69
|
"change-email": "change-email";
|
|
76
70
|
"email-verification": "email-verification";
|
|
77
71
|
"forget-password": "forget-password";
|
|
78
72
|
}>;
|
|
79
|
-
},
|
|
73
|
+
}, import("zod/v4/core").$strip>;
|
|
80
74
|
metadata: {
|
|
81
75
|
openapi: {
|
|
82
76
|
operationId: string;
|
|
@@ -96,17 +90,17 @@ declare const emailOTP: (options: EmailOTPOptions) => {
|
|
|
96
90
|
};
|
|
97
91
|
};
|
|
98
92
|
}, string>;
|
|
99
|
-
getVerificationOTP:
|
|
93
|
+
getVerificationOTP: import("better-call").StrictEndpoint<string, {
|
|
100
94
|
method: "GET";
|
|
101
|
-
query: zod.ZodObject<{
|
|
102
|
-
email: zod.ZodString;
|
|
103
|
-
type: zod.ZodEnum<{
|
|
95
|
+
query: import("zod").ZodObject<{
|
|
96
|
+
email: import("zod").ZodString;
|
|
97
|
+
type: import("zod").ZodEnum<{
|
|
104
98
|
"sign-in": "sign-in";
|
|
105
99
|
"change-email": "change-email";
|
|
106
100
|
"email-verification": "email-verification";
|
|
107
101
|
"forget-password": "forget-password";
|
|
108
102
|
}>;
|
|
109
|
-
},
|
|
103
|
+
}, import("zod/v4/core").$strip>;
|
|
110
104
|
metadata: {
|
|
111
105
|
openapi: {
|
|
112
106
|
operationId: string;
|
|
@@ -138,18 +132,18 @@ declare const emailOTP: (options: EmailOTPOptions) => {
|
|
|
138
132
|
} | {
|
|
139
133
|
otp: string;
|
|
140
134
|
}>;
|
|
141
|
-
checkVerificationOTP:
|
|
135
|
+
checkVerificationOTP: import("better-call").StrictEndpoint<"/email-otp/check-verification-otp", {
|
|
142
136
|
method: "POST";
|
|
143
|
-
body: zod.ZodObject<{
|
|
144
|
-
email: zod.ZodString;
|
|
145
|
-
type: zod.ZodEnum<{
|
|
137
|
+
body: import("zod").ZodObject<{
|
|
138
|
+
email: import("zod").ZodString;
|
|
139
|
+
type: import("zod").ZodEnum<{
|
|
146
140
|
"sign-in": "sign-in";
|
|
147
141
|
"change-email": "change-email";
|
|
148
142
|
"email-verification": "email-verification";
|
|
149
143
|
"forget-password": "forget-password";
|
|
150
144
|
}>;
|
|
151
|
-
otp: zod.ZodString;
|
|
152
|
-
},
|
|
145
|
+
otp: import("zod").ZodString;
|
|
146
|
+
}, import("zod/v4/core").$strip>;
|
|
153
147
|
metadata: {
|
|
154
148
|
openapi: {
|
|
155
149
|
operationId: string;
|
|
@@ -176,12 +170,12 @@ declare const emailOTP: (options: EmailOTPOptions) => {
|
|
|
176
170
|
}, {
|
|
177
171
|
success: boolean;
|
|
178
172
|
}>;
|
|
179
|
-
verifyEmailOTP:
|
|
173
|
+
verifyEmailOTP: import("better-call").StrictEndpoint<"/email-otp/verify-email", {
|
|
180
174
|
method: "POST";
|
|
181
|
-
body: zod.ZodObject<{
|
|
182
|
-
email: zod.ZodString;
|
|
183
|
-
otp: zod.ZodString;
|
|
184
|
-
},
|
|
175
|
+
body: import("zod").ZodObject<{
|
|
176
|
+
email: import("zod").ZodString;
|
|
177
|
+
otp: import("zod").ZodString;
|
|
178
|
+
}, import("zod/v4/core").$strip>;
|
|
185
179
|
metadata: {
|
|
186
180
|
openapi: {
|
|
187
181
|
description: string;
|
|
@@ -240,14 +234,14 @@ declare const emailOTP: (options: EmailOTPOptions) => {
|
|
|
240
234
|
image?: string | null | undefined;
|
|
241
235
|
} & Record<string, any>;
|
|
242
236
|
}>;
|
|
243
|
-
signInEmailOTP:
|
|
237
|
+
signInEmailOTP: import("better-call").StrictEndpoint<"/sign-in/email-otp", {
|
|
244
238
|
method: "POST";
|
|
245
|
-
body: zod.ZodIntersection<zod.ZodObject<{
|
|
246
|
-
email: zod.ZodString;
|
|
247
|
-
otp: zod.ZodString;
|
|
248
|
-
name: zod.ZodOptional<zod.ZodString>;
|
|
249
|
-
image: zod.ZodOptional<zod.ZodString>;
|
|
250
|
-
},
|
|
239
|
+
body: import("zod").ZodIntersection<import("zod").ZodObject<{
|
|
240
|
+
email: import("zod").ZodString;
|
|
241
|
+
otp: import("zod").ZodString;
|
|
242
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
243
|
+
image: import("zod").ZodOptional<import("zod").ZodString>;
|
|
244
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
251
245
|
metadata: {
|
|
252
246
|
openapi: {
|
|
253
247
|
operationId: string;
|
|
@@ -288,11 +282,11 @@ declare const emailOTP: (options: EmailOTPOptions) => {
|
|
|
288
282
|
image?: string | null | undefined;
|
|
289
283
|
};
|
|
290
284
|
}>;
|
|
291
|
-
requestPasswordResetEmailOTP:
|
|
285
|
+
requestPasswordResetEmailOTP: import("better-call").StrictEndpoint<"/email-otp/request-password-reset", {
|
|
292
286
|
method: "POST";
|
|
293
|
-
body: zod.ZodObject<{
|
|
294
|
-
email: zod.ZodString;
|
|
295
|
-
},
|
|
287
|
+
body: import("zod").ZodObject<{
|
|
288
|
+
email: import("zod").ZodString;
|
|
289
|
+
}, import("zod/v4/core").$strip>;
|
|
296
290
|
metadata: {
|
|
297
291
|
openapi: {
|
|
298
292
|
operationId: string;
|
|
@@ -320,11 +314,11 @@ declare const emailOTP: (options: EmailOTPOptions) => {
|
|
|
320
314
|
}, {
|
|
321
315
|
success: boolean;
|
|
322
316
|
}>;
|
|
323
|
-
forgetPasswordEmailOTP:
|
|
317
|
+
forgetPasswordEmailOTP: import("better-call").StrictEndpoint<"/forget-password/email-otp", {
|
|
324
318
|
method: "POST";
|
|
325
|
-
body: zod.ZodObject<{
|
|
326
|
-
email: zod.ZodString;
|
|
327
|
-
},
|
|
319
|
+
body: import("zod").ZodObject<{
|
|
320
|
+
email: import("zod").ZodString;
|
|
321
|
+
}, import("zod/v4/core").$strip>;
|
|
328
322
|
metadata: {
|
|
329
323
|
openapi: {
|
|
330
324
|
operationId: string;
|
|
@@ -352,13 +346,13 @@ declare const emailOTP: (options: EmailOTPOptions) => {
|
|
|
352
346
|
}, {
|
|
353
347
|
success: boolean;
|
|
354
348
|
}>;
|
|
355
|
-
resetPasswordEmailOTP:
|
|
349
|
+
resetPasswordEmailOTP: import("better-call").StrictEndpoint<"/email-otp/reset-password", {
|
|
356
350
|
method: "POST";
|
|
357
|
-
body: zod.ZodObject<{
|
|
358
|
-
email: zod.ZodString;
|
|
359
|
-
otp: zod.ZodString;
|
|
360
|
-
password: zod.ZodString;
|
|
361
|
-
},
|
|
351
|
+
body: import("zod").ZodObject<{
|
|
352
|
+
email: import("zod").ZodString;
|
|
353
|
+
otp: import("zod").ZodString;
|
|
354
|
+
password: import("zod").ZodString;
|
|
355
|
+
}, import("zod/v4/core").$strip>;
|
|
362
356
|
metadata: {
|
|
363
357
|
openapi: {
|
|
364
358
|
operationId: string;
|
|
@@ -385,13 +379,13 @@ declare const emailOTP: (options: EmailOTPOptions) => {
|
|
|
385
379
|
}, {
|
|
386
380
|
success: boolean;
|
|
387
381
|
}>;
|
|
388
|
-
requestEmailChangeEmailOTP:
|
|
382
|
+
requestEmailChangeEmailOTP: import("better-call").StrictEndpoint<"/email-otp/request-email-change", {
|
|
389
383
|
method: "POST";
|
|
390
|
-
body: zod.ZodObject<{
|
|
391
|
-
newEmail: zod.ZodString;
|
|
392
|
-
otp: zod.ZodOptional<zod.ZodString>;
|
|
393
|
-
},
|
|
394
|
-
use: ((inputContext:
|
|
384
|
+
body: import("zod").ZodObject<{
|
|
385
|
+
newEmail: import("zod").ZodString;
|
|
386
|
+
otp: import("zod").ZodOptional<import("zod").ZodString>;
|
|
387
|
+
}, import("zod/v4/core").$strip>;
|
|
388
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
395
389
|
session: {
|
|
396
390
|
session: Record<string, any> & {
|
|
397
391
|
id: string;
|
|
@@ -440,13 +434,13 @@ declare const emailOTP: (options: EmailOTPOptions) => {
|
|
|
440
434
|
}, {
|
|
441
435
|
success: boolean;
|
|
442
436
|
}>;
|
|
443
|
-
changeEmailEmailOTP:
|
|
437
|
+
changeEmailEmailOTP: import("better-call").StrictEndpoint<"/email-otp/change-email", {
|
|
444
438
|
method: "POST";
|
|
445
|
-
body: zod.ZodObject<{
|
|
446
|
-
newEmail: zod.ZodString;
|
|
447
|
-
otp: zod.ZodString;
|
|
448
|
-
},
|
|
449
|
-
use: ((inputContext:
|
|
439
|
+
body: import("zod").ZodObject<{
|
|
440
|
+
newEmail: import("zod").ZodString;
|
|
441
|
+
otp: import("zod").ZodString;
|
|
442
|
+
}, import("zod/v4/core").$strip>;
|
|
443
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
450
444
|
session: {
|
|
451
445
|
session: Record<string, any> & {
|
|
452
446
|
id: string;
|
|
@@ -498,8 +492,8 @@ declare const emailOTP: (options: EmailOTPOptions) => {
|
|
|
498
492
|
};
|
|
499
493
|
hooks: {
|
|
500
494
|
after: {
|
|
501
|
-
matcher(context:
|
|
502
|
-
handler: (inputContext:
|
|
495
|
+
matcher(context: import("@better-auth/core").HookEndpointContext): boolean;
|
|
496
|
+
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>;
|
|
503
497
|
}[];
|
|
504
498
|
};
|
|
505
499
|
rateLimit: ({
|
|
@@ -541,9 +535,9 @@ declare const emailOTP: (options: EmailOTPOptions) => {
|
|
|
541
535
|
})[];
|
|
542
536
|
options: EmailOTPOptions;
|
|
543
537
|
$ERROR_CODES: {
|
|
544
|
-
OTP_EXPIRED:
|
|
545
|
-
INVALID_OTP:
|
|
546
|
-
TOO_MANY_ATTEMPTS:
|
|
538
|
+
OTP_EXPIRED: import("@better-auth/core/utils/error-codes").RawError<"OTP_EXPIRED">;
|
|
539
|
+
INVALID_OTP: import("@better-auth/core/utils/error-codes").RawError<"INVALID_OTP">;
|
|
540
|
+
TOO_MANY_ATTEMPTS: import("@better-auth/core/utils/error-codes").RawError<"TOO_MANY_ATTEMPTS">;
|
|
547
541
|
};
|
|
548
542
|
};
|
|
549
543
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { formCsrfMiddleware } from "../../api/middlewares/origin-check.mjs";
|
|
1
2
|
import { parseUserInput, parseUserOutput } from "../../db/schema.mjs";
|
|
2
3
|
import { getDate } from "../../utils/date.mjs";
|
|
3
4
|
import { generateRandomString } from "../../crypto/random.mjs";
|
|
@@ -72,6 +73,7 @@ const sendVerificationOTPBodySchema = z.object({
|
|
|
72
73
|
*/
|
|
73
74
|
const sendVerificationOTP = (opts) => createAuthEndpoint("/email-otp/send-verification-otp", {
|
|
74
75
|
method: "POST",
|
|
76
|
+
use: [formCsrfMiddleware],
|
|
75
77
|
body: sendVerificationOTPBodySchema,
|
|
76
78
|
metadata: { openapi: {
|
|
77
79
|
operationId: "sendEmailVerificationOTP",
|
|
@@ -8,25 +8,25 @@ import { MicrosoftEntraIdOptions, microsoftEntraId } from "./providers/microsoft
|
|
|
8
8
|
import { OktaOptions, okta } from "./providers/okta.mjs";
|
|
9
9
|
import { PatreonOptions, patreon } from "./providers/patreon.mjs";
|
|
10
10
|
import { SlackOptions, slack } from "./providers/slack.mjs";
|
|
11
|
+
import { YandexOptions, yandex } from "./providers/yandex.mjs";
|
|
12
|
+
import "./providers/index.mjs";
|
|
11
13
|
import { BaseOAuthProviderOptions, genericOAuth } from "./index.mjs";
|
|
12
14
|
import { GENERIC_OAUTH_ERROR_CODES } from "./error-codes.mjs";
|
|
13
|
-
import * as _better_auth_core_utils_error_codes0 from "@better-auth/core/utils/error-codes";
|
|
14
|
-
|
|
15
15
|
//#region src/plugins/generic-oauth/client.d.ts
|
|
16
16
|
declare const genericOAuthClient: () => {
|
|
17
17
|
id: "generic-oauth-client";
|
|
18
18
|
version: string;
|
|
19
19
|
$InferServerPlugin: ReturnType<typeof genericOAuth>;
|
|
20
20
|
$ERROR_CODES: {
|
|
21
|
-
INVALID_OAUTH_CONFIGURATION:
|
|
22
|
-
TOKEN_URL_NOT_FOUND:
|
|
23
|
-
PROVIDER_CONFIG_NOT_FOUND:
|
|
24
|
-
PROVIDER_ID_REQUIRED:
|
|
25
|
-
INVALID_OAUTH_CONFIG:
|
|
26
|
-
SESSION_REQUIRED:
|
|
27
|
-
ISSUER_MISMATCH:
|
|
28
|
-
ISSUER_MISSING:
|
|
21
|
+
INVALID_OAUTH_CONFIGURATION: import("@better-auth/core/utils/error-codes").RawError<"INVALID_OAUTH_CONFIGURATION">;
|
|
22
|
+
TOKEN_URL_NOT_FOUND: import("@better-auth/core/utils/error-codes").RawError<"TOKEN_URL_NOT_FOUND">;
|
|
23
|
+
PROVIDER_CONFIG_NOT_FOUND: import("@better-auth/core/utils/error-codes").RawError<"PROVIDER_CONFIG_NOT_FOUND">;
|
|
24
|
+
PROVIDER_ID_REQUIRED: import("@better-auth/core/utils/error-codes").RawError<"PROVIDER_ID_REQUIRED">;
|
|
25
|
+
INVALID_OAUTH_CONFIG: import("@better-auth/core/utils/error-codes").RawError<"INVALID_OAUTH_CONFIG">;
|
|
26
|
+
SESSION_REQUIRED: import("@better-auth/core/utils/error-codes").RawError<"SESSION_REQUIRED">;
|
|
27
|
+
ISSUER_MISMATCH: import("@better-auth/core/utils/error-codes").RawError<"ISSUER_MISMATCH">;
|
|
28
|
+
ISSUER_MISSING: import("@better-auth/core/utils/error-codes").RawError<"ISSUER_MISSING">;
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
//#endregion
|
|
32
|
-
export { genericOAuthClient };
|
|
32
|
+
export { type Auth0Options, type BaseOAuthProviderOptions, GENERIC_OAUTH_ERROR_CODES, type GenericOAuthConfig, type GenericOAuthOptions, type GumroadOptions, type HubSpotOptions, type KeycloakOptions, type LineOptions, type MicrosoftEntraIdOptions, type OktaOptions, type PatreonOptions, type SlackOptions, type YandexOptions, type auth0, genericOAuthClient, type gumroad, type hubspot, type keycloak, type line, type microsoftEntraId, type okta, type patreon, type slack, type yandex };
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import * as _better_auth_core_utils_error_codes0 from "@better-auth/core/utils/error-codes";
|
|
2
|
-
|
|
3
1
|
//#region src/plugins/generic-oauth/error-codes.d.ts
|
|
4
2
|
declare const GENERIC_OAUTH_ERROR_CODES: {
|
|
5
|
-
INVALID_OAUTH_CONFIGURATION:
|
|
6
|
-
TOKEN_URL_NOT_FOUND:
|
|
7
|
-
PROVIDER_CONFIG_NOT_FOUND:
|
|
8
|
-
PROVIDER_ID_REQUIRED:
|
|
9
|
-
INVALID_OAUTH_CONFIG:
|
|
10
|
-
SESSION_REQUIRED:
|
|
11
|
-
ISSUER_MISMATCH:
|
|
12
|
-
ISSUER_MISSING:
|
|
3
|
+
INVALID_OAUTH_CONFIGURATION: import("@better-auth/core/utils/error-codes").RawError<"INVALID_OAUTH_CONFIGURATION">;
|
|
4
|
+
TOKEN_URL_NOT_FOUND: import("@better-auth/core/utils/error-codes").RawError<"TOKEN_URL_NOT_FOUND">;
|
|
5
|
+
PROVIDER_CONFIG_NOT_FOUND: import("@better-auth/core/utils/error-codes").RawError<"PROVIDER_CONFIG_NOT_FOUND">;
|
|
6
|
+
PROVIDER_ID_REQUIRED: import("@better-auth/core/utils/error-codes").RawError<"PROVIDER_ID_REQUIRED">;
|
|
7
|
+
INVALID_OAUTH_CONFIG: import("@better-auth/core/utils/error-codes").RawError<"INVALID_OAUTH_CONFIG">;
|
|
8
|
+
SESSION_REQUIRED: import("@better-auth/core/utils/error-codes").RawError<"SESSION_REQUIRED">;
|
|
9
|
+
ISSUER_MISMATCH: import("@better-auth/core/utils/error-codes").RawError<"ISSUER_MISMATCH">;
|
|
10
|
+
ISSUER_MISSING: import("@better-auth/core/utils/error-codes").RawError<"ISSUER_MISSING">;
|
|
13
11
|
};
|
|
14
12
|
//#endregion
|
|
15
13
|
export { GENERIC_OAUTH_ERROR_CODES };
|
|
@@ -8,14 +8,10 @@ import { MicrosoftEntraIdOptions, microsoftEntraId } from "./providers/microsoft
|
|
|
8
8
|
import { OktaOptions, okta } from "./providers/okta.mjs";
|
|
9
9
|
import { PatreonOptions, patreon } from "./providers/patreon.mjs";
|
|
10
10
|
import { SlackOptions, slack } from "./providers/slack.mjs";
|
|
11
|
+
import { YandexOptions, yandex } from "./providers/yandex.mjs";
|
|
12
|
+
import "./providers/index.mjs";
|
|
11
13
|
import { AuthContext } from "@better-auth/core";
|
|
12
|
-
import * as _better_auth_core_oauth20 from "@better-auth/core/oauth2";
|
|
13
14
|
import { OAuthProvider } from "@better-auth/core/oauth2";
|
|
14
|
-
import * as _better_auth_core_utils_error_codes0 from "@better-auth/core/utils/error-codes";
|
|
15
|
-
import * as better_call0 from "better-call";
|
|
16
|
-
import * as zod from "zod";
|
|
17
|
-
import * as zod_v4_core0 from "zod/v4/core";
|
|
18
|
-
|
|
19
15
|
//#region src/plugins/generic-oauth/index.d.ts
|
|
20
16
|
declare module "@better-auth/core" {
|
|
21
17
|
interface BetterAuthPluginRegistry<AuthOptions, Options> {
|
|
@@ -29,7 +25,8 @@ declare module "@better-auth/core" {
|
|
|
29
25
|
* Extracts common fields from GenericOAuthConfig and makes clientSecret required.
|
|
30
26
|
*/
|
|
31
27
|
type BaseOAuthProviderOptions = Omit<Pick<GenericOAuthConfig, "clientId" | "clientSecret" | "scopes" | "redirectURI" | "pkce" | "disableImplicitSignUp" | "disableSignUp" | "overrideUserInfo">, "clientSecret"> & {
|
|
32
|
-
/** OAuth client secret (required for provider options) */
|
|
28
|
+
/** OAuth client secret (required for provider options) */
|
|
29
|
+
clientSecret: string;
|
|
33
30
|
};
|
|
34
31
|
/**
|
|
35
32
|
* A generic OAuth plugin that can be used to add OAuth support to any provider
|
|
@@ -39,22 +36,22 @@ declare const genericOAuth: (options: GenericOAuthOptions) => {
|
|
|
39
36
|
version: string;
|
|
40
37
|
init: (ctx: AuthContext) => {
|
|
41
38
|
context: {
|
|
42
|
-
socialProviders: OAuthProvider<Record<string, any>, Partial<
|
|
39
|
+
socialProviders: OAuthProvider<Record<string, any>, Partial<import("@better-auth/core/oauth2").ProviderOptions<any>>>[];
|
|
43
40
|
};
|
|
44
41
|
};
|
|
45
42
|
endpoints: {
|
|
46
|
-
signInWithOAuth2:
|
|
43
|
+
signInWithOAuth2: import("better-call").StrictEndpoint<"/sign-in/oauth2", {
|
|
47
44
|
method: "POST";
|
|
48
|
-
body: zod.ZodObject<{
|
|
49
|
-
providerId: zod.ZodString;
|
|
50
|
-
callbackURL: zod.ZodOptional<zod.ZodString>;
|
|
51
|
-
errorCallbackURL: zod.ZodOptional<zod.ZodString>;
|
|
52
|
-
newUserCallbackURL: zod.ZodOptional<zod.ZodString>;
|
|
53
|
-
disableRedirect: zod.ZodOptional<zod.ZodBoolean>;
|
|
54
|
-
scopes: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
|
|
55
|
-
requestSignUp: zod.ZodOptional<zod.ZodBoolean>;
|
|
56
|
-
additionalData: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodAny>>;
|
|
57
|
-
},
|
|
45
|
+
body: import("zod").ZodObject<{
|
|
46
|
+
providerId: import("zod").ZodString;
|
|
47
|
+
callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
48
|
+
errorCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
49
|
+
newUserCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
50
|
+
disableRedirect: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
51
|
+
scopes: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
52
|
+
requestSignUp: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
53
|
+
additionalData: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
54
|
+
}, import("zod/v4/core").$strip>;
|
|
58
55
|
metadata: {
|
|
59
56
|
openapi: {
|
|
60
57
|
description: string;
|
|
@@ -84,15 +81,15 @@ declare const genericOAuth: (options: GenericOAuthOptions) => {
|
|
|
84
81
|
url: string;
|
|
85
82
|
redirect: boolean;
|
|
86
83
|
}>;
|
|
87
|
-
oAuth2Callback:
|
|
84
|
+
oAuth2Callback: import("better-call").StrictEndpoint<"/oauth2/callback/:providerId", {
|
|
88
85
|
method: "GET";
|
|
89
|
-
query: zod.ZodObject<{
|
|
90
|
-
code: zod.ZodOptional<zod.ZodString>;
|
|
91
|
-
error: zod.ZodOptional<zod.ZodString>;
|
|
92
|
-
error_description: zod.ZodOptional<zod.ZodString>;
|
|
93
|
-
state: zod.ZodOptional<zod.ZodString>;
|
|
94
|
-
iss: zod.ZodOptional<zod.ZodString>;
|
|
95
|
-
},
|
|
86
|
+
query: import("zod").ZodObject<{
|
|
87
|
+
code: import("zod").ZodOptional<import("zod").ZodString>;
|
|
88
|
+
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
89
|
+
error_description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
90
|
+
state: import("zod").ZodOptional<import("zod").ZodString>;
|
|
91
|
+
iss: import("zod").ZodOptional<import("zod").ZodString>;
|
|
92
|
+
}, import("zod/v4/core").$strip>;
|
|
96
93
|
metadata: {
|
|
97
94
|
allowedMediaTypes: string[];
|
|
98
95
|
openapi: {
|
|
@@ -118,15 +115,15 @@ declare const genericOAuth: (options: GenericOAuthOptions) => {
|
|
|
118
115
|
scope: "server";
|
|
119
116
|
};
|
|
120
117
|
}, never>;
|
|
121
|
-
oAuth2LinkAccount:
|
|
118
|
+
oAuth2LinkAccount: import("better-call").StrictEndpoint<"/oauth2/link", {
|
|
122
119
|
method: "POST";
|
|
123
|
-
body: zod.ZodObject<{
|
|
124
|
-
providerId: zod.ZodString;
|
|
125
|
-
callbackURL: zod.ZodString;
|
|
126
|
-
scopes: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
|
|
127
|
-
errorCallbackURL: zod.ZodOptional<zod.ZodString>;
|
|
128
|
-
},
|
|
129
|
-
use: ((inputContext:
|
|
120
|
+
body: import("zod").ZodObject<{
|
|
121
|
+
providerId: import("zod").ZodString;
|
|
122
|
+
callbackURL: import("zod").ZodString;
|
|
123
|
+
scopes: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
124
|
+
errorCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
125
|
+
}, import("zod/v4/core").$strip>;
|
|
126
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
130
127
|
session: {
|
|
131
128
|
session: Record<string, any> & {
|
|
132
129
|
id: string;
|
|
@@ -186,15 +183,15 @@ declare const genericOAuth: (options: GenericOAuthOptions) => {
|
|
|
186
183
|
};
|
|
187
184
|
options: GenericOAuthOptions;
|
|
188
185
|
$ERROR_CODES: {
|
|
189
|
-
INVALID_OAUTH_CONFIGURATION:
|
|
190
|
-
TOKEN_URL_NOT_FOUND:
|
|
191
|
-
PROVIDER_CONFIG_NOT_FOUND:
|
|
192
|
-
PROVIDER_ID_REQUIRED:
|
|
193
|
-
INVALID_OAUTH_CONFIG:
|
|
194
|
-
SESSION_REQUIRED:
|
|
195
|
-
ISSUER_MISMATCH:
|
|
196
|
-
ISSUER_MISSING:
|
|
186
|
+
INVALID_OAUTH_CONFIGURATION: import("@better-auth/core/utils/error-codes").RawError<"INVALID_OAUTH_CONFIGURATION">;
|
|
187
|
+
TOKEN_URL_NOT_FOUND: import("@better-auth/core/utils/error-codes").RawError<"TOKEN_URL_NOT_FOUND">;
|
|
188
|
+
PROVIDER_CONFIG_NOT_FOUND: import("@better-auth/core/utils/error-codes").RawError<"PROVIDER_CONFIG_NOT_FOUND">;
|
|
189
|
+
PROVIDER_ID_REQUIRED: import("@better-auth/core/utils/error-codes").RawError<"PROVIDER_ID_REQUIRED">;
|
|
190
|
+
INVALID_OAUTH_CONFIG: import("@better-auth/core/utils/error-codes").RawError<"INVALID_OAUTH_CONFIG">;
|
|
191
|
+
SESSION_REQUIRED: import("@better-auth/core/utils/error-codes").RawError<"SESSION_REQUIRED">;
|
|
192
|
+
ISSUER_MISMATCH: import("@better-auth/core/utils/error-codes").RawError<"ISSUER_MISMATCH">;
|
|
193
|
+
ISSUER_MISSING: import("@better-auth/core/utils/error-codes").RawError<"ISSUER_MISSING">;
|
|
197
194
|
};
|
|
198
195
|
};
|
|
199
196
|
//#endregion
|
|
200
|
-
export { Auth0Options, BaseOAuthProviderOptions, type GenericOAuthConfig, type GenericOAuthOptions, GumroadOptions, HubSpotOptions, KeycloakOptions, LineOptions, MicrosoftEntraIdOptions, OktaOptions, PatreonOptions, SlackOptions, auth0, genericOAuth, gumroad, hubspot, keycloak, line, microsoftEntraId, okta, patreon, slack };
|
|
197
|
+
export { type Auth0Options, BaseOAuthProviderOptions, type GenericOAuthConfig, type GenericOAuthOptions, type GumroadOptions, type HubSpotOptions, type KeycloakOptions, type LineOptions, type MicrosoftEntraIdOptions, type OktaOptions, type PatreonOptions, type SlackOptions, type YandexOptions, auth0, genericOAuth, gumroad, hubspot, keycloak, line, microsoftEntraId, okta, patreon, slack, yandex };
|
|
@@ -10,6 +10,7 @@ import { microsoftEntraId } from "./providers/microsoft-entra-id.mjs";
|
|
|
10
10
|
import { okta } from "./providers/okta.mjs";
|
|
11
11
|
import { patreon } from "./providers/patreon.mjs";
|
|
12
12
|
import { slack } from "./providers/slack.mjs";
|
|
13
|
+
import { yandex } from "./providers/yandex.mjs";
|
|
13
14
|
import { APIError } from "@better-auth/core/error";
|
|
14
15
|
import { applyDefaultAccessTokenExpiry, createAuthorizationURL, refreshAccessToken, validateAuthorizationCode } from "@better-auth/core/oauth2";
|
|
15
16
|
import { betterFetch } from "@better-fetch/fetch";
|
|
@@ -145,4 +146,4 @@ const genericOAuth = (options) => {
|
|
|
145
146
|
};
|
|
146
147
|
};
|
|
147
148
|
//#endregion
|
|
148
|
-
export { auth0, genericOAuth, gumroad, hubspot, keycloak, line, microsoftEntraId, okta, patreon, slack };
|
|
149
|
+
export { auth0, genericOAuth, gumroad, hubspot, keycloak, line, microsoftEntraId, okta, patreon, slack, yandex };
|
|
@@ -6,4 +6,6 @@ import { LineOptions, line } from "./line.mjs";
|
|
|
6
6
|
import { MicrosoftEntraIdOptions, microsoftEntraId } from "./microsoft-entra-id.mjs";
|
|
7
7
|
import { OktaOptions, okta } from "./okta.mjs";
|
|
8
8
|
import { PatreonOptions, patreon } from "./patreon.mjs";
|
|
9
|
-
import { SlackOptions, slack } from "./slack.mjs";
|
|
9
|
+
import { SlackOptions, slack } from "./slack.mjs";
|
|
10
|
+
import { YandexOptions, yandex } from "./yandex.mjs";
|
|
11
|
+
export { type Auth0Options, type GumroadOptions, type HubSpotOptions, type KeycloakOptions, type LineOptions, type MicrosoftEntraIdOptions, type OktaOptions, type PatreonOptions, type SlackOptions, type YandexOptions, auth0, gumroad, hubspot, keycloak, line, microsoftEntraId, okta, patreon, slack, yandex };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { GenericOAuthConfig } from "../types.mjs";
|
|
2
|
+
import { BaseOAuthProviderOptions } from "../index.mjs";
|
|
3
|
+
//#region src/plugins/generic-oauth/providers/yandex.d.ts
|
|
4
|
+
interface YandexOptions extends BaseOAuthProviderOptions {}
|
|
5
|
+
/**
|
|
6
|
+
* Yandex OAuth provider helper
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { genericOAuth, yandex } from "better-auth/plugins/generic-oauth";
|
|
11
|
+
*
|
|
12
|
+
* export const auth = betterAuth({
|
|
13
|
+
* plugins: [
|
|
14
|
+
* genericOAuth({
|
|
15
|
+
* config: [
|
|
16
|
+
* yandex({
|
|
17
|
+
* clientId: process.env.YANDEX_CLIENT_ID,
|
|
18
|
+
* clientSecret: process.env.YANDEX_CLIENT_SECRET,
|
|
19
|
+
* }),
|
|
20
|
+
* ],
|
|
21
|
+
* }),
|
|
22
|
+
* ],
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare function yandex(options: YandexOptions): GenericOAuthConfig;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { YandexOptions, yandex };
|