@better-auth/core 1.5.6 → 1.6.0-beta.0
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/api/index.d.mts +42 -13
- package/dist/api/index.mjs +0 -4
- package/dist/async_hooks/index.d.mts +1 -2
- package/dist/async_hooks/index.mjs +0 -2
- package/dist/async_hooks/pure.index.d.mts +1 -2
- package/dist/async_hooks/pure.index.mjs +0 -2
- package/dist/context/endpoint-context.d.mts +2 -3
- package/dist/context/endpoint-context.mjs +0 -3
- package/dist/context/global.d.mts +1 -2
- package/dist/context/global.mjs +1 -3
- package/dist/context/index.mjs +1 -2
- package/dist/context/request-state.d.mts +1 -2
- package/dist/context/request-state.mjs +0 -3
- package/dist/context/transaction.d.mts +1 -2
- package/dist/context/transaction.mjs +0 -3
- package/dist/db/adapter/factory.d.mts +1 -2
- package/dist/db/adapter/factory.mjs +3 -7
- package/dist/db/adapter/get-default-field-name.d.mts +1 -2
- package/dist/db/adapter/get-default-field-name.mjs +0 -3
- package/dist/db/adapter/get-default-model-name.d.mts +1 -2
- package/dist/db/adapter/get-default-model-name.mjs +0 -3
- package/dist/db/adapter/get-field-attributes.d.mts +1 -2
- package/dist/db/adapter/get-field-attributes.mjs +0 -3
- package/dist/db/adapter/get-field-name.d.mts +1 -2
- package/dist/db/adapter/get-field-name.mjs +0 -3
- package/dist/db/adapter/get-id-field.d.mts +1 -2
- package/dist/db/adapter/get-id-field.mjs +0 -4
- package/dist/db/adapter/get-model-name.d.mts +1 -2
- package/dist/db/adapter/get-model-name.mjs +0 -3
- package/dist/db/adapter/index.d.mts +9 -2
- package/dist/db/adapter/index.mjs +0 -3
- package/dist/db/adapter/types.d.mts +1 -2
- package/dist/db/adapter/utils.d.mts +1 -2
- package/dist/db/adapter/utils.mjs +0 -2
- package/dist/db/get-tables.d.mts +1 -2
- package/dist/db/get-tables.mjs +0 -2
- package/dist/db/index.mjs +1 -2
- package/dist/db/plugin.d.mts +1 -2
- package/dist/db/schema/account.d.mts +1 -2
- package/dist/db/schema/account.mjs +0 -3
- package/dist/db/schema/rate-limit.d.mts +1 -2
- package/dist/db/schema/rate-limit.mjs +0 -3
- package/dist/db/schema/session.d.mts +1 -2
- package/dist/db/schema/session.mjs +0 -3
- package/dist/db/schema/shared.d.mts +1 -2
- package/dist/db/schema/shared.mjs +0 -3
- package/dist/db/schema/user.d.mts +1 -2
- package/dist/db/schema/user.mjs +0 -3
- package/dist/db/schema/verification.d.mts +1 -2
- package/dist/db/schema/verification.mjs +0 -3
- package/dist/db/type.d.mts +1 -2
- package/dist/env/color-depth.d.mts +1 -2
- package/dist/env/color-depth.mjs +0 -3
- package/dist/env/env-impl.d.mts +1 -2
- package/dist/env/env-impl.mjs +0 -2
- package/dist/env/index.mjs +1 -2
- package/dist/env/logger.d.mts +1 -2
- package/dist/env/logger.mjs +0 -3
- package/dist/error/codes.d.mts +1 -2
- package/dist/error/codes.mjs +0 -3
- package/dist/error/index.d.mts +1 -2
- package/dist/error/index.mjs +0 -3
- package/dist/index.mjs +1 -1
- package/dist/instrumentation/attributes.d.mts +1 -2
- package/dist/instrumentation/attributes.mjs +0 -3
- package/dist/instrumentation/index.mjs +1 -2
- package/dist/instrumentation/tracer.d.mts +1 -2
- package/dist/instrumentation/tracer.mjs +29 -16
- package/dist/oauth2/client-credentials-token.d.mts +1 -2
- package/dist/oauth2/client-credentials-token.mjs +0 -3
- package/dist/oauth2/create-authorization-url.d.mts +1 -2
- package/dist/oauth2/create-authorization-url.mjs +0 -3
- package/dist/oauth2/index.mjs +1 -2
- package/dist/oauth2/oauth-provider.d.mts +1 -2
- package/dist/oauth2/refresh-access-token.d.mts +1 -2
- package/dist/oauth2/refresh-access-token.mjs +0 -3
- package/dist/oauth2/utils.d.mts +1 -2
- package/dist/oauth2/utils.mjs +0 -3
- package/dist/oauth2/validate-authorization-code.d.mts +1 -2
- package/dist/oauth2/validate-authorization-code.mjs +0 -4
- package/dist/oauth2/verify.d.mts +1 -2
- package/dist/oauth2/verify.mjs +0 -4
- package/dist/social-providers/apple.d.mts +1 -2
- package/dist/social-providers/apple.mjs +0 -4
- package/dist/social-providers/atlassian.d.mts +1 -2
- package/dist/social-providers/atlassian.mjs +0 -5
- package/dist/social-providers/cognito.d.mts +1 -2
- package/dist/social-providers/cognito.mjs +0 -5
- package/dist/social-providers/discord.d.mts +1 -2
- package/dist/social-providers/discord.mjs +0 -4
- package/dist/social-providers/dropbox.d.mts +1 -2
- package/dist/social-providers/dropbox.mjs +0 -4
- package/dist/social-providers/facebook.d.mts +1 -2
- package/dist/social-providers/facebook.mjs +0 -4
- package/dist/social-providers/figma.d.mts +1 -2
- package/dist/social-providers/figma.mjs +0 -5
- package/dist/social-providers/github.d.mts +1 -2
- package/dist/social-providers/github.mjs +0 -5
- package/dist/social-providers/gitlab.d.mts +1 -2
- package/dist/social-providers/gitlab.mjs +0 -4
- package/dist/social-providers/google.d.mts +1 -2
- package/dist/social-providers/google.mjs +0 -5
- package/dist/social-providers/huggingface.d.mts +1 -2
- package/dist/social-providers/huggingface.mjs +0 -4
- package/dist/social-providers/index.d.mts +1 -2
- package/dist/social-providers/index.mjs +0 -3
- package/dist/social-providers/kakao.d.mts +1 -2
- package/dist/social-providers/kakao.mjs +0 -4
- package/dist/social-providers/kick.d.mts +1 -2
- package/dist/social-providers/kick.mjs +0 -4
- package/dist/social-providers/line.d.mts +1 -2
- package/dist/social-providers/line.mjs +0 -4
- package/dist/social-providers/linear.d.mts +1 -2
- package/dist/social-providers/linear.mjs +0 -4
- package/dist/social-providers/linkedin.d.mts +1 -2
- package/dist/social-providers/linkedin.mjs +0 -4
- package/dist/social-providers/microsoft-entra-id.d.mts +1 -2
- package/dist/social-providers/microsoft-entra-id.mjs +0 -5
- package/dist/social-providers/naver.d.mts +1 -2
- package/dist/social-providers/naver.mjs +0 -4
- package/dist/social-providers/notion.d.mts +1 -2
- package/dist/social-providers/notion.mjs +0 -4
- package/dist/social-providers/paybin.d.mts +1 -2
- package/dist/social-providers/paybin.mjs +0 -5
- package/dist/social-providers/paypal.d.mts +1 -2
- package/dist/social-providers/paypal.mjs +0 -5
- package/dist/social-providers/polar.d.mts +1 -2
- package/dist/social-providers/polar.mjs +0 -4
- package/dist/social-providers/railway.d.mts +1 -2
- package/dist/social-providers/railway.mjs +0 -4
- package/dist/social-providers/reddit.d.mts +1 -2
- package/dist/social-providers/reddit.mjs +0 -4
- package/dist/social-providers/roblox.d.mts +1 -2
- package/dist/social-providers/roblox.mjs +0 -4
- package/dist/social-providers/salesforce.d.mts +1 -2
- package/dist/social-providers/salesforce.mjs +0 -5
- package/dist/social-providers/slack.d.mts +1 -2
- package/dist/social-providers/slack.mjs +0 -4
- package/dist/social-providers/spotify.d.mts +1 -2
- package/dist/social-providers/spotify.mjs +0 -4
- package/dist/social-providers/tiktok.d.mts +1 -2
- package/dist/social-providers/tiktok.mjs +0 -4
- package/dist/social-providers/twitch.d.mts +1 -2
- package/dist/social-providers/twitch.mjs +0 -5
- package/dist/social-providers/twitter.d.mts +1 -2
- package/dist/social-providers/twitter.mjs +0 -4
- package/dist/social-providers/vercel.d.mts +1 -2
- package/dist/social-providers/vercel.mjs +0 -4
- package/dist/social-providers/vk.d.mts +1 -2
- package/dist/social-providers/vk.mjs +0 -4
- package/dist/social-providers/wechat.d.mts +1 -2
- package/dist/social-providers/wechat.mjs +0 -3
- package/dist/social-providers/zoom.d.mts +1 -2
- package/dist/social-providers/zoom.mjs +0 -4
- package/dist/types/context.d.mts +3 -5
- package/dist/types/cookie.d.mts +1 -2
- package/dist/types/helper.d.mts +1 -2
- package/dist/types/init-options.d.mts +14 -6
- package/dist/types/plugin-client.d.mts +2 -2
- package/dist/types/plugin.d.mts +6 -3
- package/dist/types/secret.d.mts +1 -2
- package/dist/utils/db.d.mts +1 -2
- package/dist/utils/db.mjs +0 -2
- package/dist/utils/deprecate.d.mts +1 -2
- package/dist/utils/deprecate.mjs +0 -2
- package/dist/utils/error-codes.d.mts +1 -2
- package/dist/utils/error-codes.mjs +0 -2
- package/dist/utils/fetch-metadata.d.mts +1 -2
- package/dist/utils/fetch-metadata.mjs +0 -2
- package/dist/utils/id.d.mts +1 -2
- package/dist/utils/id.mjs +0 -3
- package/dist/utils/ip.d.mts +1 -2
- package/dist/utils/ip.mjs +0 -3
- package/dist/utils/json.d.mts +1 -2
- package/dist/utils/json.mjs +0 -4
- package/dist/utils/string.d.mts +1 -2
- package/dist/utils/string.mjs +0 -2
- package/dist/utils/url.d.mts +1 -2
- package/dist/utils/url.mjs +0 -2
- package/package.json +11 -9
- package/src/api/index.ts +151 -41
- package/src/context/endpoint-context.ts +2 -1
- package/src/db/adapter/factory.ts +2 -0
- package/src/db/adapter/index.ts +8 -0
- package/src/instrumentation/tracer.ts +40 -12
- package/src/social-providers/index.ts +0 -2
- package/src/types/context.ts +2 -3
- package/src/types/init-options.ts +13 -4
- package/src/types/plugin-client.ts +1 -0
- package/src/types/plugin.ts +15 -1
- package/dist/api/index.mjs.map +0 -1
- package/dist/async_hooks/index.mjs.map +0 -1
- package/dist/async_hooks/pure.index.mjs.map +0 -1
- package/dist/context/endpoint-context.mjs.map +0 -1
- package/dist/context/global.mjs.map +0 -1
- package/dist/context/request-state.mjs.map +0 -1
- package/dist/context/transaction.mjs.map +0 -1
- package/dist/db/adapter/factory.mjs.map +0 -1
- package/dist/db/adapter/get-default-field-name.mjs.map +0 -1
- package/dist/db/adapter/get-default-model-name.mjs.map +0 -1
- package/dist/db/adapter/get-field-attributes.mjs.map +0 -1
- package/dist/db/adapter/get-field-name.mjs.map +0 -1
- package/dist/db/adapter/get-id-field.mjs.map +0 -1
- package/dist/db/adapter/get-model-name.mjs.map +0 -1
- package/dist/db/adapter/index.mjs.map +0 -1
- package/dist/db/adapter/utils.mjs.map +0 -1
- package/dist/db/get-tables.mjs.map +0 -1
- package/dist/db/schema/account.mjs.map +0 -1
- package/dist/db/schema/rate-limit.mjs.map +0 -1
- package/dist/db/schema/session.mjs.map +0 -1
- package/dist/db/schema/shared.mjs.map +0 -1
- package/dist/db/schema/user.mjs.map +0 -1
- package/dist/db/schema/verification.mjs.map +0 -1
- package/dist/env/color-depth.mjs.map +0 -1
- package/dist/env/env-impl.mjs.map +0 -1
- package/dist/env/logger.mjs.map +0 -1
- package/dist/error/codes.mjs.map +0 -1
- package/dist/error/index.mjs.map +0 -1
- package/dist/instrumentation/attributes.mjs.map +0 -1
- package/dist/instrumentation/tracer.mjs.map +0 -1
- package/dist/oauth2/client-credentials-token.mjs.map +0 -1
- package/dist/oauth2/create-authorization-url.mjs.map +0 -1
- package/dist/oauth2/refresh-access-token.mjs.map +0 -1
- package/dist/oauth2/utils.mjs.map +0 -1
- package/dist/oauth2/validate-authorization-code.mjs.map +0 -1
- package/dist/oauth2/verify.mjs.map +0 -1
- package/dist/social-providers/apple.mjs.map +0 -1
- package/dist/social-providers/atlassian.mjs.map +0 -1
- package/dist/social-providers/cognito.mjs.map +0 -1
- package/dist/social-providers/discord.mjs.map +0 -1
- package/dist/social-providers/dropbox.mjs.map +0 -1
- package/dist/social-providers/facebook.mjs.map +0 -1
- package/dist/social-providers/figma.mjs.map +0 -1
- package/dist/social-providers/github.mjs.map +0 -1
- package/dist/social-providers/gitlab.mjs.map +0 -1
- package/dist/social-providers/google.mjs.map +0 -1
- package/dist/social-providers/huggingface.mjs.map +0 -1
- package/dist/social-providers/index.mjs.map +0 -1
- package/dist/social-providers/kakao.mjs.map +0 -1
- package/dist/social-providers/kick.mjs.map +0 -1
- package/dist/social-providers/line.mjs.map +0 -1
- package/dist/social-providers/linear.mjs.map +0 -1
- package/dist/social-providers/linkedin.mjs.map +0 -1
- package/dist/social-providers/microsoft-entra-id.mjs.map +0 -1
- package/dist/social-providers/naver.mjs.map +0 -1
- package/dist/social-providers/notion.mjs.map +0 -1
- package/dist/social-providers/paybin.mjs.map +0 -1
- package/dist/social-providers/paypal.mjs.map +0 -1
- package/dist/social-providers/polar.mjs.map +0 -1
- package/dist/social-providers/railway.mjs.map +0 -1
- package/dist/social-providers/reddit.mjs.map +0 -1
- package/dist/social-providers/roblox.mjs.map +0 -1
- package/dist/social-providers/salesforce.mjs.map +0 -1
- package/dist/social-providers/slack.mjs.map +0 -1
- package/dist/social-providers/spotify.mjs.map +0 -1
- package/dist/social-providers/tiktok.mjs.map +0 -1
- package/dist/social-providers/twitch.mjs.map +0 -1
- package/dist/social-providers/twitter.mjs.map +0 -1
- package/dist/social-providers/vercel.mjs.map +0 -1
- package/dist/social-providers/vk.mjs.map +0 -1
- package/dist/social-providers/wechat.mjs.map +0 -1
- package/dist/social-providers/zoom.mjs.map +0 -1
- package/dist/utils/db.mjs.map +0 -1
- package/dist/utils/deprecate.mjs.map +0 -1
- package/dist/utils/error-codes.mjs.map +0 -1
- package/dist/utils/fetch-metadata.mjs.map +0 -1
- package/dist/utils/id.mjs.map +0 -1
- package/dist/utils/ip.mjs.map +0 -1
- package/dist/utils/json.mjs.map +0 -1
- package/dist/utils/string.mjs.map +0 -1
- package/dist/utils/url.mjs.map +0 -1
- package/src/context/request-state.test.ts +0 -94
- package/src/db/adapter/get-id-field.test.ts +0 -222
- package/src/db/test/get-tables.test.ts +0 -116
- package/src/env/logger.test.ts +0 -34
- package/src/instrumentation/instrumentation.test.ts +0 -139
- package/src/oauth2/refresh-access-token.test.ts +0 -90
- package/src/oauth2/validate-token.test.ts +0 -229
- package/src/utils/deprecate.test.ts +0 -71
- package/src/utils/fetch-metadata.test.ts +0 -28
- package/src/utils/ip.test.ts +0 -255
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
|
|
3
2
|
//#region src/db/schema/shared.ts
|
|
4
3
|
const coreSchema = z.object({
|
|
5
4
|
id: z.string(),
|
|
6
5
|
createdAt: z.date().default(() => /* @__PURE__ */ new Date()),
|
|
7
6
|
updatedAt: z.date().default(() => /* @__PURE__ */ new Date())
|
|
8
7
|
});
|
|
9
|
-
|
|
10
8
|
//#endregion
|
|
11
9
|
export { coreSchema };
|
|
12
|
-
//# sourceMappingURL=shared.mjs.map
|
|
@@ -19,5 +19,4 @@ type BaseUser = z.infer<typeof userSchema>;
|
|
|
19
19
|
*/
|
|
20
20
|
type User<DBOptions extends BetterAuthOptions["user"] = BetterAuthOptions["user"], Plugins extends BetterAuthOptions["plugins"] = BetterAuthOptions["plugins"]> = Prettify<BaseUser & InferDBFieldsFromOptions<DBOptions> & InferDBFieldsFromPlugins<"user", Plugins>>;
|
|
21
21
|
//#endregion
|
|
22
|
-
export { BaseUser, User, userSchema };
|
|
23
|
-
//# sourceMappingURL=user.d.mts.map
|
|
22
|
+
export { BaseUser, User, userSchema };
|
package/dist/db/schema/user.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { coreSchema } from "./shared.mjs";
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
|
|
4
3
|
//#region src/db/schema/user.ts
|
|
5
4
|
const userSchema = coreSchema.extend({
|
|
6
5
|
email: z.string().transform((val) => val.toLowerCase()),
|
|
@@ -8,7 +7,5 @@ const userSchema = coreSchema.extend({
|
|
|
8
7
|
name: z.string(),
|
|
9
8
|
image: z.string().nullish()
|
|
10
9
|
});
|
|
11
|
-
|
|
12
10
|
//#endregion
|
|
13
11
|
export { userSchema };
|
|
14
|
-
//# sourceMappingURL=user.mjs.map
|
|
@@ -18,5 +18,4 @@ type BaseVerification = z.infer<typeof verificationSchema>;
|
|
|
18
18
|
*/
|
|
19
19
|
type Verification<DBOptions extends BetterAuthOptions["verification"] = BetterAuthOptions["verification"], Plugins extends BetterAuthOptions["plugins"] = BetterAuthOptions["plugins"]> = Prettify<BaseVerification & InferDBFieldsFromOptions<DBOptions> & InferDBFieldsFromPlugins<"verification", Plugins>>;
|
|
20
20
|
//#endregion
|
|
21
|
-
export { BaseVerification, Verification, verificationSchema };
|
|
22
|
-
//# sourceMappingURL=verification.d.mts.map
|
|
21
|
+
export { BaseVerification, Verification, verificationSchema };
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { coreSchema } from "./shared.mjs";
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
|
|
4
3
|
//#region src/db/schema/verification.ts
|
|
5
4
|
const verificationSchema = coreSchema.extend({
|
|
6
5
|
value: z.string(),
|
|
7
6
|
expiresAt: z.date(),
|
|
8
7
|
identifier: z.string()
|
|
9
8
|
});
|
|
10
|
-
|
|
11
9
|
//#endregion
|
|
12
10
|
export { verificationSchema };
|
|
13
|
-
//# sourceMappingURL=verification.mjs.map
|
package/dist/db/type.d.mts
CHANGED
|
@@ -164,5 +164,4 @@ interface SecondaryStorage {
|
|
|
164
164
|
delete: (key: string) => Awaitable<void | null | string>;
|
|
165
165
|
}
|
|
166
166
|
//#endregion
|
|
167
|
-
export { BaseModelNames, BetterAuthDBSchema, DBFieldAttribute, DBFieldAttributeConfig, DBFieldType, DBPrimitive, InferDBFieldInput, InferDBFieldOutput, InferDBFieldsFromOptions, InferDBFieldsFromOptionsInput, InferDBFieldsFromPlugins, InferDBFieldsFromPluginsInput, InferDBFieldsInput, InferDBFieldsOutput, InferDBValueType, ModelNames, SecondaryStorage };
|
|
168
|
-
//# sourceMappingURL=type.d.mts.map
|
|
167
|
+
export { BaseModelNames, BetterAuthDBSchema, DBFieldAttribute, DBFieldAttributeConfig, DBFieldType, DBPrimitive, InferDBFieldInput, InferDBFieldOutput, InferDBFieldsFromOptions, InferDBFieldsFromOptionsInput, InferDBFieldsFromPlugins, InferDBFieldsFromPluginsInput, InferDBFieldsInput, InferDBFieldsOutput, InferDBValueType, ModelNames, SecondaryStorage };
|
package/dist/env/color-depth.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { env, getEnvVar } from "./env-impl.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/env/color-depth.ts
|
|
4
3
|
const COLORS_2 = 1;
|
|
5
4
|
const COLORS_16 = 4;
|
|
@@ -83,7 +82,5 @@ function getColorDepth() {
|
|
|
83
82
|
if (getEnvVar("COLORTERM")) return COLORS_16;
|
|
84
83
|
return COLORS_2;
|
|
85
84
|
}
|
|
86
|
-
|
|
87
85
|
//#endregion
|
|
88
86
|
export { getColorDepth };
|
|
89
|
-
//# sourceMappingURL=color-depth.mjs.map
|
package/dist/env/env-impl.d.mts
CHANGED
|
@@ -29,5 +29,4 @@ declare const ENV: Readonly<{
|
|
|
29
29
|
readonly BETTER_AUTH_TELEMETRY_ENDPOINT: string | undefined;
|
|
30
30
|
}>;
|
|
31
31
|
//#endregion
|
|
32
|
-
export { ENV, EnvObject, env, getBooleanEnvVar, getEnvVar, isDevelopment, isProduction, isTest, nodeENV };
|
|
33
|
-
//# sourceMappingURL=env-impl.d.mts.map
|
|
32
|
+
export { ENV, EnvObject, env, getBooleanEnvVar, getEnvVar, isDevelopment, isProduction, isTest, nodeENV };
|
package/dist/env/env-impl.mjs
CHANGED
package/dist/env/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ENV, env, getBooleanEnvVar, getEnvVar, isDevelopment, isProduction, isTest, nodeENV } from "./env-impl.mjs";
|
|
2
2
|
import { getColorDepth } from "./color-depth.mjs";
|
|
3
3
|
import { TTY_COLORS, createLogger, levels, logger, shouldPublishLog } from "./logger.mjs";
|
|
4
|
-
|
|
5
|
-
export { ENV, TTY_COLORS, createLogger, env, getBooleanEnvVar, getColorDepth, getEnvVar, isDevelopment, isProduction, isTest, levels, logger, nodeENV, shouldPublishLog };
|
|
4
|
+
export { ENV, TTY_COLORS, createLogger, env, getBooleanEnvVar, getColorDepth, getEnvVar, isDevelopment, isProduction, isTest, levels, logger, nodeENV, shouldPublishLog };
|
package/dist/env/logger.d.mts
CHANGED
|
@@ -45,5 +45,4 @@ type InternalLogger = { [K in LogLevel]: (...params: LogHandlerParams) => void }
|
|
|
45
45
|
declare const createLogger: (options?: Logger | undefined) => InternalLogger;
|
|
46
46
|
declare const logger: InternalLogger;
|
|
47
47
|
//#endregion
|
|
48
|
-
export { InternalLogger, LogHandlerParams, LogLevel, Logger, TTY_COLORS, createLogger, levels, logger, shouldPublishLog };
|
|
49
|
-
//# sourceMappingURL=logger.d.mts.map
|
|
48
|
+
export { InternalLogger, LogHandlerParams, LogLevel, Logger, TTY_COLORS, createLogger, levels, logger, shouldPublishLog };
|
package/dist/env/logger.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getColorDepth } from "./color-depth.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/env/logger.ts
|
|
4
3
|
const TTY_COLORS = {
|
|
5
4
|
reset: "\x1B[0m",
|
|
@@ -76,7 +75,5 @@ const createLogger = (options) => {
|
|
|
76
75
|
};
|
|
77
76
|
};
|
|
78
77
|
const logger = createLogger();
|
|
79
|
-
|
|
80
78
|
//#endregion
|
|
81
79
|
export { TTY_COLORS, createLogger, levels, logger, shouldPublishLog };
|
|
82
|
-
//# sourceMappingURL=logger.mjs.map
|
package/dist/error/codes.d.mts
CHANGED
package/dist/error/codes.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { defineErrorCodes } from "../utils/error-codes.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/error/codes.ts
|
|
4
3
|
const BASE_ERROR_CODES = defineErrorCodes({
|
|
5
4
|
USER_NOT_FOUND: "User not found",
|
|
@@ -51,7 +50,5 @@ const BASE_ERROR_CODES = defineErrorCodes({
|
|
|
51
50
|
BODY_MUST_BE_AN_OBJECT: "Body must be an object",
|
|
52
51
|
PASSWORD_ALREADY_SET: "User already has a password set"
|
|
53
52
|
});
|
|
54
|
-
|
|
55
53
|
//#endregion
|
|
56
54
|
export { BASE_ERROR_CODES };
|
|
57
|
-
//# sourceMappingURL=codes.mjs.map
|
package/dist/error/index.d.mts
CHANGED
|
@@ -16,5 +16,4 @@ declare class APIError extends APIError$1 {
|
|
|
16
16
|
}): APIError;
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
|
-
export { APIError, type APIErrorCode, BASE_ERROR_CODES, BetterAuthError };
|
|
20
|
-
//# sourceMappingURL=index.d.mts.map
|
|
19
|
+
export { APIError, type APIErrorCode, BASE_ERROR_CODES, BetterAuthError };
|
package/dist/error/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BASE_ERROR_CODES } from "./codes.mjs";
|
|
2
2
|
import { APIError as APIError$1 } from "better-call/error";
|
|
3
|
-
|
|
4
3
|
//#region src/error/index.ts
|
|
5
4
|
var BetterAuthError = class extends Error {
|
|
6
5
|
constructor(message, options) {
|
|
@@ -24,7 +23,5 @@ var APIError = class APIError extends APIError$1 {
|
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
25
|
};
|
|
27
|
-
|
|
28
26
|
//#endregion
|
|
29
27
|
export { APIError, BASE_ERROR_CODES, BetterAuthError };
|
|
30
|
-
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
@@ -8,5 +8,4 @@ declare const ATTR_HOOK_TYPE: "better_auth.hook.type";
|
|
|
8
8
|
/** Execution context (e.g. user, plugin:id). */
|
|
9
9
|
declare const ATTR_CONTEXT: "better_auth.context";
|
|
10
10
|
//#endregion
|
|
11
|
-
export { ATTR_CONTEXT, ATTR_DB_COLLECTION_NAME, ATTR_DB_OPERATION_NAME, ATTR_HOOK_TYPE, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_HTTP_ROUTE, ATTR_OPERATION_ID };
|
|
12
|
-
//# sourceMappingURL=attributes.d.mts.map
|
|
11
|
+
export { ATTR_CONTEXT, ATTR_DB_COLLECTION_NAME, ATTR_DB_OPERATION_NAME, ATTR_HOOK_TYPE, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_HTTP_ROUTE, ATTR_OPERATION_ID };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ATTR_DB_COLLECTION_NAME, ATTR_DB_OPERATION_NAME, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_HTTP_ROUTE } from "@opentelemetry/semantic-conventions";
|
|
2
|
-
|
|
3
2
|
//#region src/instrumentation/attributes.ts
|
|
4
3
|
/** Operation identifier (e.g. getSession, signUpWithEmailAndPassword). Uses endpoint operationId when set, otherwise the endpoint key. */
|
|
5
4
|
const ATTR_OPERATION_ID = "better_auth.operation_id";
|
|
@@ -7,7 +6,5 @@ const ATTR_OPERATION_ID = "better_auth.operation_id";
|
|
|
7
6
|
const ATTR_HOOK_TYPE = "better_auth.hook.type";
|
|
8
7
|
/** Execution context (e.g. user, plugin:id). */
|
|
9
8
|
const ATTR_CONTEXT = "better_auth.context";
|
|
10
|
-
|
|
11
9
|
//#endregion
|
|
12
10
|
export { ATTR_CONTEXT, ATTR_DB_COLLECTION_NAME, ATTR_DB_OPERATION_NAME, ATTR_HOOK_TYPE, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_HTTP_ROUTE, ATTR_OPERATION_ID };
|
|
13
|
-
//# sourceMappingURL=attributes.mjs.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { ATTR_CONTEXT, ATTR_DB_COLLECTION_NAME, ATTR_DB_OPERATION_NAME, ATTR_HOOK_TYPE, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_HTTP_ROUTE, ATTR_OPERATION_ID } from "./attributes.mjs";
|
|
2
2
|
import { withSpan } from "./tracer.mjs";
|
|
3
|
-
|
|
4
|
-
export { ATTR_CONTEXT, ATTR_DB_COLLECTION_NAME, ATTR_DB_OPERATION_NAME, ATTR_HOOK_TYPE, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_HTTP_ROUTE, ATTR_OPERATION_ID, withSpan };
|
|
3
|
+
export { ATTR_CONTEXT, ATTR_DB_COLLECTION_NAME, ATTR_DB_OPERATION_NAME, ATTR_HOOK_TYPE, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_HTTP_ROUTE, ATTR_OPERATION_ID, withSpan };
|
|
@@ -10,5 +10,4 @@
|
|
|
10
10
|
declare function withSpan<T>(name: string, attributes: Record<string, string | number | boolean>, fn: () => T): T;
|
|
11
11
|
declare function withSpan<T>(name: string, attributes: Record<string, string | number | boolean>, fn: () => Promise<T>): Promise<T>;
|
|
12
12
|
//#endregion
|
|
13
|
-
export { withSpan };
|
|
14
|
-
//# sourceMappingURL=tracer.d.mts.map
|
|
13
|
+
export { withSpan };
|
|
@@ -1,7 +1,32 @@
|
|
|
1
|
+
import { ATTR_HTTP_RESPONSE_STATUS_CODE } from "./attributes.mjs";
|
|
1
2
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
2
|
-
|
|
3
3
|
//#region src/instrumentation/tracer.ts
|
|
4
|
-
const tracer = trace.getTracer("better-auth", "1.
|
|
4
|
+
const tracer = trace.getTracer("better-auth", "1.6.0-beta.0");
|
|
5
|
+
/**
|
|
6
|
+
* Better-auth uses `throw ctx.redirect(url)` for flow control (e.g. OAuth
|
|
7
|
+
* callbacks). These are APIErrors with 3xx status codes and should not be
|
|
8
|
+
* recorded as span errors.
|
|
9
|
+
*/
|
|
10
|
+
function isRedirectError(err) {
|
|
11
|
+
if (err != null && typeof err === "object" && "name" in err && err.name === "APIError" && "statusCode" in err) {
|
|
12
|
+
const status = err.statusCode;
|
|
13
|
+
return status >= 300 && status < 400;
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
function endSpanWithError(span, err) {
|
|
18
|
+
if (isRedirectError(err)) {
|
|
19
|
+
span.setAttribute(ATTR_HTTP_RESPONSE_STATUS_CODE, err.statusCode);
|
|
20
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
21
|
+
} else {
|
|
22
|
+
span.recordException(err);
|
|
23
|
+
span.setStatus({
|
|
24
|
+
code: SpanStatusCode.ERROR,
|
|
25
|
+
message: String(err?.message ?? err)
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
span.end();
|
|
29
|
+
}
|
|
5
30
|
function withSpan(name, attributes, fn) {
|
|
6
31
|
return tracer.startActiveSpan(name, { attributes }, (span) => {
|
|
7
32
|
try {
|
|
@@ -10,28 +35,16 @@ function withSpan(name, attributes, fn) {
|
|
|
10
35
|
span.end();
|
|
11
36
|
return value;
|
|
12
37
|
}).catch((err) => {
|
|
13
|
-
span
|
|
14
|
-
span.setStatus({
|
|
15
|
-
code: SpanStatusCode.ERROR,
|
|
16
|
-
message: String(err.message ?? err)
|
|
17
|
-
});
|
|
18
|
-
span.end();
|
|
38
|
+
endSpanWithError(span, err);
|
|
19
39
|
throw err;
|
|
20
40
|
});
|
|
21
41
|
span.end();
|
|
22
42
|
return result;
|
|
23
43
|
} catch (err) {
|
|
24
|
-
span
|
|
25
|
-
span.setStatus({
|
|
26
|
-
code: SpanStatusCode.ERROR,
|
|
27
|
-
message: String(err?.message ?? err)
|
|
28
|
-
});
|
|
29
|
-
span.end();
|
|
44
|
+
endSpanWithError(span, err);
|
|
30
45
|
throw err;
|
|
31
46
|
}
|
|
32
47
|
});
|
|
33
48
|
}
|
|
34
|
-
|
|
35
49
|
//#endregion
|
|
36
50
|
export { withSpan };
|
|
37
|
-
//# sourceMappingURL=tracer.mjs.map
|
|
@@ -53,5 +53,4 @@ declare function clientCredentialsToken({
|
|
|
53
53
|
resource?: (string | string[]) | undefined;
|
|
54
54
|
}): Promise<OAuth2Tokens>;
|
|
55
55
|
//#endregion
|
|
56
|
-
export { clientCredentialsToken, clientCredentialsTokenRequest, createClientCredentialsTokenRequest };
|
|
57
|
-
//# sourceMappingURL=client-credentials-token.d.mts.map
|
|
56
|
+
export { clientCredentialsToken, clientCredentialsTokenRequest, createClientCredentialsTokenRequest };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { base64Url } from "@better-auth/utils/base64";
|
|
2
2
|
import { betterFetch } from "@better-fetch/fetch";
|
|
3
|
-
|
|
4
3
|
//#region src/oauth2/client-credentials-token.ts
|
|
5
4
|
async function clientCredentialsTokenRequest({ options, scope, authentication, resource }) {
|
|
6
5
|
options = typeof options === "function" ? await options() : options;
|
|
@@ -61,7 +60,5 @@ async function clientCredentialsToken({ options, tokenEndpoint, scope, authentic
|
|
|
61
60
|
}
|
|
62
61
|
return tokens;
|
|
63
62
|
}
|
|
64
|
-
|
|
65
63
|
//#endregion
|
|
66
64
|
export { clientCredentialsToken, clientCredentialsTokenRequest, createClientCredentialsTokenRequest };
|
|
67
|
-
//# sourceMappingURL=client-credentials-token.mjs.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { generateCodeChallenge } from "./utils.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/oauth2/create-authorization-url.ts
|
|
4
3
|
async function createAuthorizationURL({ id, options, authorizationEndpoint, state, codeVerifier, scopes, claims, redirectURI, duration, prompt, accessType, responseType, display, loginHint, hd, responseMode, additionalParams, scopeJoiner }) {
|
|
5
4
|
options = typeof options === "function" ? await options() : options;
|
|
@@ -38,7 +37,5 @@ async function createAuthorizationURL({ id, options, authorizationEndpoint, stat
|
|
|
38
37
|
});
|
|
39
38
|
return url;
|
|
40
39
|
}
|
|
41
|
-
|
|
42
40
|
//#endregion
|
|
43
41
|
export { createAuthorizationURL };
|
|
44
|
-
//# sourceMappingURL=create-authorization-url.mjs.map
|
package/dist/oauth2/index.mjs
CHANGED
|
@@ -4,5 +4,4 @@ import { createAuthorizationURL } from "./create-authorization-url.mjs";
|
|
|
4
4
|
import { createRefreshAccessTokenRequest, refreshAccessToken, refreshAccessTokenRequest } from "./refresh-access-token.mjs";
|
|
5
5
|
import { authorizationCodeRequest, createAuthorizationCodeRequest, validateAuthorizationCode, validateToken } from "./validate-authorization-code.mjs";
|
|
6
6
|
import { getJwks, verifyAccessToken, verifyJwsAccessToken } from "./verify.mjs";
|
|
7
|
-
|
|
8
|
-
export { authorizationCodeRequest, clientCredentialsToken, clientCredentialsTokenRequest, createAuthorizationCodeRequest, createAuthorizationURL, createClientCredentialsTokenRequest, createRefreshAccessTokenRequest, generateCodeChallenge, getJwks, getOAuth2Tokens, refreshAccessToken, refreshAccessTokenRequest, validateAuthorizationCode, validateToken, verifyAccessToken, verifyJwsAccessToken };
|
|
7
|
+
export { authorizationCodeRequest, clientCredentialsToken, clientCredentialsTokenRequest, createAuthorizationCodeRequest, createAuthorizationURL, createClientCredentialsTokenRequest, createRefreshAccessTokenRequest, generateCodeChallenge, getJwks, getOAuth2Tokens, refreshAccessToken, refreshAccessTokenRequest, validateAuthorizationCode, validateToken, verifyAccessToken, verifyJwsAccessToken };
|
|
@@ -189,5 +189,4 @@ type ProviderOptions<Profile extends Record<string, any> = any> = {
|
|
|
189
189
|
overrideUserInfoOnSignIn?: boolean | undefined;
|
|
190
190
|
};
|
|
191
191
|
//#endregion
|
|
192
|
-
export { OAuth2Tokens, OAuth2UserInfo, OAuthProvider, ProviderOptions };
|
|
193
|
-
//# sourceMappingURL=oauth-provider.d.mts.map
|
|
192
|
+
export { OAuth2Tokens, OAuth2UserInfo, OAuthProvider, ProviderOptions };
|
|
@@ -51,5 +51,4 @@ declare function refreshAccessToken({
|
|
|
51
51
|
extraParams?: Record<string, string> | undefined;
|
|
52
52
|
}): Promise<OAuth2Tokens>;
|
|
53
53
|
//#endregion
|
|
54
|
-
export { createRefreshAccessTokenRequest, refreshAccessToken, refreshAccessTokenRequest };
|
|
55
|
-
//# sourceMappingURL=refresh-access-token.d.mts.map
|
|
54
|
+
export { createRefreshAccessTokenRequest, refreshAccessToken, refreshAccessTokenRequest };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { base64 } from "@better-auth/utils/base64";
|
|
2
2
|
import { betterFetch } from "@better-fetch/fetch";
|
|
3
|
-
|
|
4
3
|
//#region src/oauth2/refresh-access-token.ts
|
|
5
4
|
async function refreshAccessTokenRequest({ refreshToken, options, authentication, extraParams, resource }) {
|
|
6
5
|
options = typeof options === "function" ? await options() : options;
|
|
@@ -70,7 +69,5 @@ async function refreshAccessToken({ refreshToken, options, tokenEndpoint, authen
|
|
|
70
69
|
}
|
|
71
70
|
return tokens;
|
|
72
71
|
}
|
|
73
|
-
|
|
74
72
|
//#endregion
|
|
75
73
|
export { createRefreshAccessTokenRequest, refreshAccessToken, refreshAccessTokenRequest };
|
|
76
|
-
//# sourceMappingURL=refresh-access-token.mjs.map
|
package/dist/oauth2/utils.d.mts
CHANGED
|
@@ -4,5 +4,4 @@ import { OAuth2Tokens } from "./oauth-provider.mjs";
|
|
|
4
4
|
declare function getOAuth2Tokens(data: Record<string, any>): OAuth2Tokens;
|
|
5
5
|
declare function generateCodeChallenge(codeVerifier: string): Promise<string>;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { generateCodeChallenge, getOAuth2Tokens };
|
|
8
|
-
//# sourceMappingURL=utils.d.mts.map
|
|
7
|
+
export { generateCodeChallenge, getOAuth2Tokens };
|
package/dist/oauth2/utils.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { base64Url } from "@better-auth/utils/base64";
|
|
2
|
-
|
|
3
2
|
//#region src/oauth2/utils.ts
|
|
4
3
|
function getOAuth2Tokens(data) {
|
|
5
4
|
const getDate = (seconds) => {
|
|
@@ -22,7 +21,5 @@ async function generateCodeChallenge(codeVerifier) {
|
|
|
22
21
|
const hash = await crypto.subtle.digest("SHA-256", data);
|
|
23
22
|
return base64Url.encode(new Uint8Array(hash), { padding: false });
|
|
24
23
|
}
|
|
25
|
-
|
|
26
24
|
//#endregion
|
|
27
25
|
export { generateCodeChallenge, getOAuth2Tokens };
|
|
28
|
-
//# sourceMappingURL=utils.mjs.map
|
|
@@ -82,5 +82,4 @@ declare function validateToken(token: string, jwksEndpoint: string, options?: {
|
|
|
82
82
|
issuer?: string | string[];
|
|
83
83
|
}): Promise<jose.JWTVerifyResult<jose.JWTPayload> & jose.ResolvedKey>;
|
|
84
84
|
//#endregion
|
|
85
|
-
export { authorizationCodeRequest, createAuthorizationCodeRequest, validateAuthorizationCode, validateToken };
|
|
86
|
-
//# sourceMappingURL=validate-authorization-code.d.mts.map
|
|
85
|
+
export { authorizationCodeRequest, createAuthorizationCodeRequest, validateAuthorizationCode, validateToken };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { getOAuth2Tokens } from "./utils.mjs";
|
|
2
|
-
import "./index.mjs";
|
|
3
2
|
import { base64 } from "@better-auth/utils/base64";
|
|
4
3
|
import { betterFetch } from "@better-fetch/fetch";
|
|
5
4
|
import { createRemoteJWKSet, jwtVerify } from "jose";
|
|
6
|
-
|
|
7
5
|
//#region src/oauth2/validate-authorization-code.ts
|
|
8
6
|
async function authorizationCodeRequest({ code, codeVerifier, redirectURI, options, authentication, deviceId, headers, additionalParams = {}, resource }) {
|
|
9
7
|
options = typeof options === "function" ? await options() : options;
|
|
@@ -77,7 +75,5 @@ async function validateToken(token, jwksEndpoint, options) {
|
|
|
77
75
|
issuer: options?.issuer
|
|
78
76
|
});
|
|
79
77
|
}
|
|
80
|
-
|
|
81
78
|
//#endregion
|
|
82
79
|
export { authorizationCodeRequest, createAuthorizationCodeRequest, validateAuthorizationCode, validateToken };
|
|
83
|
-
//# sourceMappingURL=validate-authorization-code.mjs.map
|
package/dist/oauth2/verify.d.mts
CHANGED
|
@@ -39,5 +39,4 @@ declare function verifyAccessToken(token: string, opts: {
|
|
|
39
39
|
remoteVerify?: VerifyAccessTokenRemote;
|
|
40
40
|
}): Promise<JWTPayload>;
|
|
41
41
|
//#endregion
|
|
42
|
-
export { getJwks, verifyAccessToken, verifyJwsAccessToken };
|
|
43
|
-
//# sourceMappingURL=verify.d.mts.map
|
|
42
|
+
export { getJwks, verifyAccessToken, verifyJwsAccessToken };
|
package/dist/oauth2/verify.mjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { logger } from "../env/logger.mjs";
|
|
2
|
-
import "../env/index.mjs";
|
|
3
2
|
import { APIError } from "better-call";
|
|
4
3
|
import { betterFetch } from "@better-fetch/fetch";
|
|
5
4
|
import { UnsecuredJWT, createLocalJWKSet, decodeProtectedHeader, jwtVerify } from "jose";
|
|
6
|
-
|
|
7
5
|
//#region src/oauth2/verify.ts
|
|
8
6
|
/** Last fetched jwks used locally in getJwks @internal */
|
|
9
7
|
let jwks;
|
|
@@ -90,7 +88,5 @@ async function verifyAccessToken(token, opts) {
|
|
|
90
88
|
}
|
|
91
89
|
return payload;
|
|
92
90
|
}
|
|
93
|
-
|
|
94
91
|
//#endregion
|
|
95
92
|
export { getJwks, verifyAccessToken, verifyJwsAccessToken };
|
|
96
|
-
//# sourceMappingURL=verify.mjs.map
|
|
@@ -114,5 +114,4 @@ declare const apple: (options: AppleOptions) => {
|
|
|
114
114
|
};
|
|
115
115
|
declare const getApplePublicKey: (kid: string) => Promise<Uint8Array<ArrayBufferLike> | CryptoKey>;
|
|
116
116
|
//#endregion
|
|
117
|
-
export { AppleNonConformUser, AppleOptions, AppleProfile, apple, getApplePublicKey };
|
|
118
|
-
//# sourceMappingURL=apple.d.mts.map
|
|
117
|
+
export { AppleNonConformUser, AppleOptions, AppleProfile, apple, getApplePublicKey };
|
|
@@ -2,10 +2,8 @@ import { APIError } from "../error/index.mjs";
|
|
|
2
2
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
3
3
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
4
4
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
5
|
-
import "../oauth2/index.mjs";
|
|
6
5
|
import { betterFetch } from "@better-fetch/fetch";
|
|
7
6
|
import { decodeJwt, decodeProtectedHeader, importJWK, jwtVerify } from "jose";
|
|
8
|
-
|
|
9
7
|
//#region src/social-providers/apple.ts
|
|
10
8
|
const apple = (options) => {
|
|
11
9
|
const tokenEndpoint = "https://appleid.apple.com/auth/token";
|
|
@@ -99,7 +97,5 @@ const getApplePublicKey = async (kid) => {
|
|
|
99
97
|
if (!jwk) throw new Error(`JWK with kid ${kid} not found`);
|
|
100
98
|
return await importJWK(jwk, jwk.alg);
|
|
101
99
|
};
|
|
102
|
-
|
|
103
100
|
//#endregion
|
|
104
101
|
export { apple, getApplePublicKey };
|
|
105
|
-
//# sourceMappingURL=apple.mjs.map
|
|
@@ -67,5 +67,4 @@ declare const atlassian: (options: AtlassianOptions) => {
|
|
|
67
67
|
options: AtlassianOptions;
|
|
68
68
|
};
|
|
69
69
|
//#endregion
|
|
70
|
-
export { AtlassianOptions, AtlassianProfile, atlassian };
|
|
71
|
-
//# sourceMappingURL=atlassian.d.mts.map
|
|
70
|
+
export { AtlassianOptions, AtlassianProfile, atlassian };
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { logger } from "../env/logger.mjs";
|
|
2
|
-
import "../env/index.mjs";
|
|
3
2
|
import { BetterAuthError } from "../error/index.mjs";
|
|
4
3
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
5
4
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
6
5
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
7
|
-
import "../oauth2/index.mjs";
|
|
8
6
|
import { betterFetch } from "@better-fetch/fetch";
|
|
9
|
-
|
|
10
7
|
//#region src/social-providers/atlassian.ts
|
|
11
8
|
const atlassian = (options) => {
|
|
12
9
|
const tokenEndpoint = "https://auth.atlassian.com/oauth/token";
|
|
@@ -79,7 +76,5 @@ const atlassian = (options) => {
|
|
|
79
76
|
options
|
|
80
77
|
};
|
|
81
78
|
};
|
|
82
|
-
|
|
83
79
|
//#endregion
|
|
84
80
|
export { atlassian };
|
|
85
|
-
//# sourceMappingURL=atlassian.mjs.map
|
|
@@ -82,5 +82,4 @@ declare const cognito: (options: CognitoOptions) => {
|
|
|
82
82
|
};
|
|
83
83
|
declare const getCognitoPublicKey: (kid: string, region: string, userPoolId: string) => Promise<Uint8Array<ArrayBufferLike> | CryptoKey>;
|
|
84
84
|
//#endregion
|
|
85
|
-
export { CognitoOptions, CognitoProfile, cognito, getCognitoPublicKey };
|
|
86
|
-
//# sourceMappingURL=cognito.d.mts.map
|
|
85
|
+
export { CognitoOptions, CognitoProfile, cognito, getCognitoPublicKey };
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { logger } from "../env/logger.mjs";
|
|
2
|
-
import "../env/index.mjs";
|
|
3
2
|
import { APIError, BetterAuthError } from "../error/index.mjs";
|
|
4
3
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
5
4
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
6
5
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
7
|
-
import "../oauth2/index.mjs";
|
|
8
6
|
import { betterFetch } from "@better-fetch/fetch";
|
|
9
7
|
import { decodeJwt, decodeProtectedHeader, importJWK, jwtVerify } from "jose";
|
|
10
|
-
|
|
11
8
|
//#region src/social-providers/cognito.ts
|
|
12
9
|
const cognito = (options) => {
|
|
13
10
|
if (!options.domain || !options.region || !options.userPoolId) {
|
|
@@ -160,7 +157,5 @@ const getCognitoPublicKey = async (kid, region, userPoolId) => {
|
|
|
160
157
|
throw error;
|
|
161
158
|
}
|
|
162
159
|
};
|
|
163
|
-
|
|
164
160
|
//#endregion
|
|
165
161
|
export { cognito, getCognitoPublicKey };
|
|
166
|
-
//# sourceMappingURL=cognito.mjs.map
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
2
2
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
3
|
-
import "../oauth2/index.mjs";
|
|
4
3
|
import { betterFetch } from "@better-fetch/fetch";
|
|
5
|
-
|
|
6
4
|
//#region src/social-providers/discord.ts
|
|
7
5
|
const discord = (options) => {
|
|
8
6
|
const tokenEndpoint = "https://discord.com/api/oauth2/token";
|
|
@@ -60,7 +58,5 @@ const discord = (options) => {
|
|
|
60
58
|
options
|
|
61
59
|
};
|
|
62
60
|
};
|
|
63
|
-
|
|
64
61
|
//#endregion
|
|
65
62
|
export { discord };
|
|
66
|
-
//# sourceMappingURL=discord.mjs.map
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
2
2
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
3
3
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
4
|
-
import "../oauth2/index.mjs";
|
|
5
4
|
import { betterFetch } from "@better-fetch/fetch";
|
|
6
|
-
|
|
7
5
|
//#region src/social-providers/dropbox.ts
|
|
8
6
|
const dropbox = (options) => {
|
|
9
7
|
const tokenEndpoint = "https://api.dropboxapi.com/oauth2/token";
|
|
@@ -70,7 +68,5 @@ const dropbox = (options) => {
|
|
|
70
68
|
options
|
|
71
69
|
};
|
|
72
70
|
};
|
|
73
|
-
|
|
74
71
|
//#endregion
|
|
75
72
|
export { dropbox };
|
|
76
|
-
//# sourceMappingURL=dropbox.mjs.map
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
2
2
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
3
3
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
4
|
-
import "../oauth2/index.mjs";
|
|
5
4
|
import { betterFetch } from "@better-fetch/fetch";
|
|
6
5
|
import { createRemoteJWKSet, decodeJwt, jwtVerify } from "jose";
|
|
7
|
-
|
|
8
6
|
//#region src/social-providers/facebook.ts
|
|
9
7
|
const facebook = (options) => {
|
|
10
8
|
return {
|
|
@@ -115,7 +113,5 @@ const facebook = (options) => {
|
|
|
115
113
|
options
|
|
116
114
|
};
|
|
117
115
|
};
|
|
118
|
-
|
|
119
116
|
//#endregion
|
|
120
117
|
export { facebook };
|
|
121
|
-
//# sourceMappingURL=facebook.mjs.map
|