@entro314labs/entro-auth 1.8.0-beta.12 → 1.8.0-beta.13
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/_virtual/_rolldown/runtime.mjs +4 -4
- package/dist/api/dispatch.d.mts +1 -1
- package/dist/api/dispatch.mjs +4 -4
- package/dist/api/index.d.mts +6 -6
- package/dist/api/index.mjs +7 -7
- package/dist/api/middlewares/authorization.mjs +1 -1
- package/dist/api/middlewares/origin-check.mjs +4 -4
- package/dist/api/rate-limiter/index.mjs +1 -1
- package/dist/api/routes/account.mjs +5 -5
- package/dist/api/routes/callback.mjs +3 -3
- package/dist/api/routes/email-verification.d.mts +1 -1
- package/dist/api/routes/email-verification.mjs +6 -6
- package/dist/api/routes/error.mjs +2 -2
- package/dist/api/routes/id-token-nonce.mjs +3 -3
- package/dist/api/routes/ok.mjs +1 -1
- package/dist/api/routes/password.mjs +4 -4
- package/dist/api/routes/session.d.mts +1 -1
- package/dist/api/routes/session.mjs +3 -3
- package/dist/api/routes/sign-in.mjs +5 -5
- package/dist/api/routes/sign-out.mjs +2 -2
- package/dist/api/routes/sign-up.d.mts +1 -1
- package/dist/api/routes/sign-up.mjs +6 -6
- package/dist/api/routes/update-session.d.mts +1 -1
- package/dist/api/routes/update-session.mjs +3 -3
- package/dist/api/routes/update-user.d.mts +1 -1
- package/dist/api/routes/update-user.mjs +4 -4
- package/dist/api/to-auth-endpoints.mjs +2 -2
- package/dist/auth/base.mjs +2 -2
- package/dist/auth/full.d.mts +1 -1
- package/dist/auth/minimal.d.mts +1 -1
- package/dist/auth/trusted-origins.mjs +1 -1
- package/dist/client/config.d.mts +6 -6
- package/dist/client/config.mjs +2 -2
- package/dist/client/index.d.mts +2 -2
- package/dist/client/lynx/index.d.mts +3 -3
- package/dist/client/lynx/index.mjs +1 -1
- package/dist/client/lynx/lynx-store.d.mts +1 -1
- package/dist/client/lynx/lynx-store.mjs +1 -1
- package/dist/client/path-to-object.d.mts +3 -3
- package/dist/client/proxy.mjs +2 -2
- package/dist/client/query.d.mts +2 -2
- package/dist/client/query.mjs +1 -1
- package/dist/client/react/index.d.mts +3 -3
- package/dist/client/react/index.mjs +1 -1
- package/dist/client/react/react-store.mjs +1 -1
- package/dist/client/session-atom.d.mts +2 -2
- package/dist/client/session-atom.mjs +1 -1
- package/dist/client/solid/index.d.mts +4 -4
- package/dist/client/solid/index.mjs +1 -1
- package/dist/client/svelte/index.d.mts +4 -4
- package/dist/client/svelte/index.mjs +1 -1
- package/dist/client/types.d.mts +9 -9
- package/dist/client/vanilla.d.mts +4 -4
- package/dist/client/vanilla.mjs +1 -1
- package/dist/client/vue/index.d.mts +4 -4
- package/dist/client/vue/index.mjs +1 -1
- package/dist/context/create-context.mjs +9 -9
- package/dist/context/helpers.mjs +4 -4
- package/dist/context/init-minimal.mjs +1 -1
- package/dist/context/init.mjs +1 -1
- package/dist/context/secret-utils.mjs +1 -1
- package/dist/cookies/index.d.mts +3 -3
- package/dist/cookies/index.mjs +7 -7
- package/dist/cookies/jwt.mjs +1 -1
- package/dist/cookies/session-store.mjs +3 -3
- package/dist/crypto/index.d.mts +1 -1
- package/dist/crypto/index.mjs +4 -4
- package/dist/crypto/jwt.mjs +1 -2
- package/dist/crypto/password.d.mts +10 -5
- package/dist/crypto/password.mjs +5 -5
- package/dist/db/adapter-kysely.mjs +1 -1
- package/dist/db/get-migration.d.mts +1 -1
- package/dist/db/get-migration.mjs +6 -6
- package/dist/db/get-schema.mjs +1 -1
- package/dist/db/index.mjs +1 -1
- package/dist/db/internal-adapter.d.mts +2 -2
- package/dist/db/internal-adapter.mjs +8 -8
- package/dist/db/revoke-unproven-account-access.d.mts +1 -1
- package/dist/db/schema.d.mts +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/integrations/next-js.mjs +1 -1
- package/dist/integrations/node.d.mts +1 -1
- package/dist/integrations/svelte-kit.d.mts +1 -1
- package/dist/integrations/svelte-kit.mjs +1 -1
- package/dist/integrations/tanstack-start-solid.mjs +1 -1
- package/dist/integrations/tanstack-start.mjs +1 -1
- package/dist/oauth2/account-key.mjs +1 -2
- package/dist/oauth2/callback.mjs +1 -1
- package/dist/oauth2/link-account.d.mts +1 -1
- package/dist/oauth2/link-account.mjs +4 -4
- package/dist/oauth2/state.d.mts +1 -1
- package/dist/oauth2/state.mjs +1 -1
- package/dist/{package.mjs → package.json.mjs} +1 -1
- package/dist/plugins/access/types.d.mts +1 -1
- package/dist/plugins/admin/admin.d.mts +5 -5
- package/dist/plugins/admin/admin.mjs +2 -2
- package/dist/plugins/admin/client.d.mts +1 -1
- package/dist/plugins/admin/error-codes.d.mts +1 -1
- package/dist/plugins/admin/routes.mjs +5 -5
- package/dist/plugins/admin/types.d.mts +1 -1
- package/dist/plugins/anonymous/index.mjs +4 -4
- package/dist/plugins/anonymous/types.d.mts +2 -2
- package/dist/plugins/bearer/index.mjs +3 -3
- package/dist/plugins/captcha/index.mjs +1 -1
- package/dist/plugins/captcha/verify-handlers/captchafox.mjs +1 -1
- package/dist/plugins/captcha/verify-handlers/cloudflare-turnstile.mjs +1 -1
- package/dist/plugins/captcha/verify-handlers/google-recaptcha.mjs +1 -1
- package/dist/plugins/captcha/verify-handlers/h-captcha.mjs +1 -1
- package/dist/plugins/custom-session/client.d.mts +1 -1
- package/dist/plugins/custom-session/index.mjs +1 -1
- package/dist/plugins/device-authorization/index.d.mts +8 -8
- package/dist/plugins/device-authorization/index.mjs +2 -2
- package/dist/plugins/device-authorization/routes.d.mts +2 -2
- package/dist/plugins/device-authorization/routes.mjs +5 -4
- package/dist/plugins/email-otp/index.mjs +1 -1
- package/dist/plugins/email-otp/routes.mjs +4 -4
- package/dist/plugins/generic-oauth/index.d.mts +2 -2
- package/dist/plugins/generic-oauth/index.mjs +6 -6
- package/dist/plugins/generic-oauth/providers/index.d.mts +38 -0
- package/dist/plugins/generic-oauth/providers/line.mjs +1 -1
- package/dist/plugins/generic-oauth/providers/microsoft-entra-id.mjs +2 -2
- package/dist/plugins/haveibeenpwned/index.mjs +4 -4
- package/dist/plugins/jwt/client.d.mts +3 -3
- package/dist/plugins/jwt/cookie-cache.mjs +2 -2
- package/dist/plugins/jwt/index.d.mts +2 -2
- package/dist/plugins/jwt/index.mjs +3 -3
- package/dist/plugins/jwt/sign.d.mts +1 -1
- package/dist/plugins/jwt/sign.mjs +2 -2
- package/dist/plugins/jwt/types.d.mts +2 -2
- package/dist/plugins/jwt/utils.d.mts +1 -1
- package/dist/plugins/jwt/utils.mjs +1 -1
- package/dist/plugins/jwt/verify.d.mts +1 -1
- package/dist/plugins/jwt/verify.mjs +4 -4
- package/dist/plugins/last-login-method/index.mjs +1 -1
- package/dist/plugins/magic-link/index.mjs +2 -2
- package/dist/plugins/multi-session/index.d.mts +1 -1
- package/dist/plugins/multi-session/index.mjs +2 -2
- package/dist/plugins/oauth-popup/client.d.mts +2 -2
- package/dist/plugins/oauth-popup/index.mjs +4 -4
- package/dist/plugins/oauth-proxy/index.mjs +4 -4
- package/dist/plugins/oauth-proxy/utils.mjs +1 -1
- package/dist/plugins/one-tap/client.d.mts +1 -1
- package/dist/plugins/one-tap/client.mjs +1 -1
- package/dist/plugins/one-tap/index.mjs +5 -5
- package/dist/plugins/one-time-token/index.d.mts +1 -1
- package/dist/plugins/one-time-token/index.mjs +3 -4
- package/dist/plugins/open-api/generator.d.mts +4 -4
- package/dist/plugins/open-api/generator.mjs +1 -1
- package/dist/plugins/open-api/index.mjs +1 -1
- package/dist/plugins/organization/adapter.d.mts +3 -3
- package/dist/plugins/organization/adapter.mjs +4 -4
- package/dist/plugins/organization/call.mjs +1 -1
- package/dist/plugins/organization/client.d.mts +3 -3
- package/dist/plugins/organization/client.mjs +1 -1
- package/dist/plugins/organization/has-permission.d.mts +1 -1
- package/dist/plugins/organization/has-permission.mjs +2 -2
- package/dist/plugins/organization/organization.d.mts +1 -1
- package/dist/plugins/organization/organization.mjs +3 -3
- package/dist/plugins/organization/routes/crud-access-control.d.mts +1 -1
- package/dist/plugins/organization/routes/crud-access-control.mjs +3 -3
- package/dist/plugins/organization/routes/crud-invites.d.mts +24 -24
- package/dist/plugins/organization/routes/crud-invites.mjs +4 -4
- package/dist/plugins/organization/routes/crud-members.d.mts +19 -19
- package/dist/plugins/organization/routes/crud-members.mjs +4 -4
- package/dist/plugins/organization/routes/crud-org.d.mts +16 -16
- package/dist/plugins/organization/routes/crud-org.mjs +3 -3
- package/dist/plugins/organization/routes/crud-team.d.mts +1 -1
- package/dist/plugins/organization/routes/crud-team.mjs +4 -4
- package/dist/plugins/organization/schema.d.mts +2 -2
- package/dist/plugins/organization/types.d.mts +2 -2
- package/dist/plugins/phone-number/client.d.mts +4 -4
- package/dist/plugins/phone-number/error-codes.d.mts +4 -4
- package/dist/plugins/phone-number/index.d.mts +4 -4
- package/dist/plugins/phone-number/index.mjs +2 -2
- package/dist/plugins/phone-number/routes.mjs +4 -4
- package/dist/plugins/phone-number/types.d.mts +1 -1
- package/dist/plugins/siwe/index.d.mts +1 -1
- package/dist/plugins/siwe/index.mjs +4 -4
- package/dist/plugins/test-utils/auth-helpers.mjs +1 -1
- package/dist/plugins/test-utils/cookie-builder.mjs +2 -4
- package/dist/plugins/two-factor/backup-codes/index.d.mts +1 -1
- package/dist/plugins/two-factor/backup-codes/index.mjs +4 -4
- package/dist/plugins/two-factor/claim.d.mts +1 -1
- package/dist/plugins/two-factor/claim.mjs +1 -1
- package/dist/plugins/two-factor/client.mjs +1 -1
- package/dist/plugins/two-factor/index.d.mts +4 -4
- package/dist/plugins/two-factor/index.mjs +6 -6
- package/dist/plugins/two-factor/otp/index.d.mts +1 -1
- package/dist/plugins/two-factor/otp/index.mjs +3 -3
- package/dist/plugins/two-factor/totp/index.d.mts +1 -1
- package/dist/plugins/two-factor/totp/index.mjs +5 -5
- package/dist/plugins/two-factor/types.d.mts +1 -1
- package/dist/plugins/two-factor/verify-two-factor.d.mts +1 -1
- package/dist/plugins/two-factor/verify-two-factor.mjs +2 -2
- package/dist/plugins/username/client.d.mts +1 -1
- package/dist/plugins/username/error-codes.d.mts +1 -1
- package/dist/plugins/username/index.d.mts +6 -6
- package/dist/plugins/username/index.mjs +4 -4
- package/dist/plugins/username/schema.d.mts +4 -4
- package/dist/state.d.mts +2 -2
- package/dist/state.mjs +3 -3
- package/dist/test-utils/http-test-instance.d.mts +7 -7
- package/dist/test-utils/http-test-instance.mjs +1 -1
- package/dist/test-utils/test-instance.d.mts +2 -2
- package/dist/test-utils/test-instance.mjs +4 -4
- package/dist/types/adapter.d.mts +2 -2
- package/dist/types/api.d.mts +1 -1
- package/dist/types/auth.d.mts +2 -2
- package/dist/types/index.d.mts +1 -1
- package/dist/types/models.d.mts +3 -3
- package/dist/types/plugins.d.mts +1 -1
- package/dist/utils/hashing.mjs +1 -1
- package/dist/utils/url.mjs +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +28 -28
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { isSafeUrlScheme } from "@entro314labs/entro-auth-core/utils/url";
|
|
1
2
|
import { PACKAGE_VERSION } from "../../version.mjs";
|
|
2
3
|
import { TWO_FACTOR_ERROR_CODES } from "./error-code.mjs";
|
|
3
|
-
import { isSafeUrlScheme } from "@entro314labs/entro-auth-core/utils/url";
|
|
4
4
|
// src/plugins/two-factor/client.ts
|
|
5
5
|
const twoFactorClient = (options) => {
|
|
6
6
|
return {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { BackupCodeOptions, backupCode2fa, encodeBackupCodes, generateBackupCodes, getBackupCodes, verifyBackupCode } from "./backup-codes/index.mjs";
|
|
2
2
|
import { OTPOptions, otp2fa } from "./otp/index.mjs";
|
|
3
3
|
import { TOTPOptions, totp2fa } from "./totp/index.mjs";
|
|
4
|
+
import * as z from "zod";
|
|
4
5
|
import { TwoFactorOptions, TwoFactorProvider, TwoFactorTable, UserWithTwoFactor } from "./types.mjs";
|
|
5
6
|
import { TwoFactorClaim, withTwoFactorClaim } from "./claim.mjs";
|
|
6
7
|
import { BACKUP_CODES_ONLY, DEFAULT_TWO_FACTOR_ALLOWED_ATTEMPTS } from "./constant.mjs";
|
|
7
8
|
import { TWO_FACTOR_ERROR_CODES } from "./error-code.mjs";
|
|
8
9
|
import { assertTwoFactorNotLocked, discardUnfinishedEnrollment, recordTwoFactorFailure, resetTwoFactorFailures, twoFactorIsOn, verifyTwoFactor } from "./verify-two-factor.mjs";
|
|
9
10
|
import { twoFactorClient } from "./client.mjs";
|
|
10
|
-
import * as z from "zod";
|
|
11
11
|
declare module "@entro314labs/entro-auth-core" {
|
|
12
12
|
interface EntroAuthPluginRegistry<AuthOptions, Options> {
|
|
13
13
|
"two-factor": {
|
|
@@ -54,16 +54,16 @@ export declare const twoFactor: <O extends TwoFactorOptions>(options?: O) => {
|
|
|
54
54
|
body: z.ZodObject<{
|
|
55
55
|
password: z.ZodOptional<z.ZodString>;
|
|
56
56
|
method: z.ZodDefault<z.ZodEnum<{
|
|
57
|
-
passkey: "passkey";
|
|
58
57
|
otp: "otp";
|
|
58
|
+
passkey: "passkey";
|
|
59
59
|
totp: "totp";
|
|
60
60
|
}>>;
|
|
61
61
|
issuer: z.ZodOptional<z.ZodString>;
|
|
62
62
|
}, z.core.$strip> | z.ZodObject<{
|
|
63
63
|
password: z.ZodString;
|
|
64
64
|
method: z.ZodDefault<z.ZodEnum<{
|
|
65
|
-
passkey: "passkey";
|
|
66
65
|
otp: "otp";
|
|
66
|
+
passkey: "passkey";
|
|
67
67
|
totp: "totp";
|
|
68
68
|
}>>;
|
|
69
69
|
issuer: z.ZodOptional<z.ZodString>;
|
|
@@ -646,7 +646,7 @@ export declare const twoFactor: <O extends TwoFactorOptions>(options?: O) => {
|
|
|
646
646
|
matcher(context: import("@entro314labs/entro-auth-core").HookEndpointContext): boolean;
|
|
647
647
|
handler: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
648
648
|
twoFactorRedirect: boolean;
|
|
649
|
-
twoFactorMethods: ("
|
|
649
|
+
twoFactorMethods: ("otp" | "passkey" | "totp")[];
|
|
650
650
|
twoFactorBackupCodes: boolean;
|
|
651
651
|
} | undefined>>;
|
|
652
652
|
}[];
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import { createHMAC } from "@better-auth/utils/hmac";
|
|
2
|
+
import { createOTP } from "@better-auth/utils/otp";
|
|
3
|
+
import { createAuthEndpoint, createAuthMiddleware } from "@entro314labs/entro-auth-core/api";
|
|
4
|
+
import { APIError, BASE_ERROR_CODES } from "@entro314labs/entro-auth-core/error";
|
|
5
|
+
import { setPendingSecondFactorUser } from "@entro314labs/entro-auth-core/utils/auth-completion";
|
|
6
|
+
import * as z from "zod";
|
|
1
7
|
import { sensitiveSessionMiddleware } from "../../api/routes/session.mjs";
|
|
2
8
|
import { asSignInGate } from "../../api/dispatch.mjs";
|
|
3
9
|
import { deleteSessionCookie, expireCookie, setSessionCookie } from "../../cookies/index.mjs";
|
|
@@ -16,12 +22,6 @@ import { schema } from "./schema.mjs";
|
|
|
16
22
|
import { totp2fa } from "./totp/index.mjs";
|
|
17
23
|
import { assertTwoFactorNotLocked, discardUnfinishedEnrollment, recordTwoFactorFailure, resetTwoFactorFailures, secondSteps, turnTwoFactorOff, twoFactorIsOn, verifyTwoFactor } from "./verify-two-factor.mjs";
|
|
18
24
|
import { twoFactorClient } from "./client.mjs";
|
|
19
|
-
import { APIError, BASE_ERROR_CODES } from "@entro314labs/entro-auth-core/error";
|
|
20
|
-
import { createAuthEndpoint, createAuthMiddleware } from "@entro314labs/entro-auth-core/api";
|
|
21
|
-
import * as z from "zod";
|
|
22
|
-
import { createHMAC } from "@better-auth/utils/hmac";
|
|
23
|
-
import { setPendingSecondFactorUser } from "@entro314labs/entro-auth-core/utils/auth-completion";
|
|
24
|
-
import { createOTP } from "@better-auth/utils/otp";
|
|
25
25
|
// src/plugins/two-factor/index.ts
|
|
26
26
|
const conflict = () => APIError.from("CONFLICT", TWO_FACTOR_ERROR_CODES.SETUP_ALREADY_STARTED);
|
|
27
27
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UserWithTwoFactor } from "../types.mjs";
|
|
2
1
|
import { Awaitable, GenericEndpointContext } from "@entro314labs/entro-auth-core";
|
|
3
2
|
import * as z from "zod";
|
|
3
|
+
import { UserWithTwoFactor } from "../types.mjs";
|
|
4
4
|
export interface OTPOptions {
|
|
5
5
|
/**
|
|
6
6
|
* How long the opt will be valid for in
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { createAuthEndpoint } from "@entro314labs/entro-auth-core/api";
|
|
2
|
+
import { APIError, BASE_ERROR_CODES } from "@entro314labs/entro-auth-core/error";
|
|
3
|
+
import * as z from "zod";
|
|
1
4
|
import { setSessionCookie } from "../../../cookies/index.mjs";
|
|
2
5
|
import { constantTimeEqual } from "../../../crypto/buffer.mjs";
|
|
3
6
|
import { generateRandomString } from "../../../crypto/random.mjs";
|
|
@@ -8,9 +11,6 @@ import { withTwoFactorClaim } from "../claim.mjs";
|
|
|
8
11
|
import { TWO_FACTOR_ERROR_CODES } from "../error-code.mjs";
|
|
9
12
|
import { defaultKeyHasher } from "../utils.mjs";
|
|
10
13
|
import { assertTwoFactorNotLocked, discardUnfinishedEnrollment, recordTwoFactorFailure, resetTwoFactorFailures, twoFactorIsOn, verifyTwoFactor } from "../verify-two-factor.mjs";
|
|
11
|
-
import { APIError, BASE_ERROR_CODES } from "@entro314labs/entro-auth-core/error";
|
|
12
|
-
import { createAuthEndpoint } from "@entro314labs/entro-auth-core/api";
|
|
13
|
-
import * as z from "zod";
|
|
14
14
|
// src/plugins/two-factor/otp/index.ts
|
|
15
15
|
const verifyOTPBodySchema = z.object({
|
|
16
16
|
code: z.string().meta({ description: "The otp code to verify. Eg: \"012345\"" }),
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { base32 } from "@better-auth/utils/base32";
|
|
2
|
+
import { createOTP } from "@better-auth/utils/otp";
|
|
3
|
+
import { createAuthEndpoint } from "@entro314labs/entro-auth-core/api";
|
|
4
|
+
import { APIError, BASE_ERROR_CODES } from "@entro314labs/entro-auth-core/error";
|
|
5
|
+
import * as z from "zod";
|
|
1
6
|
import { sessionMiddleware } from "../../../api/routes/session.mjs";
|
|
2
7
|
import { setSessionCookie } from "../../../cookies/index.mjs";
|
|
3
8
|
import { symmetricDecrypt } from "../../../crypto/index.mjs";
|
|
@@ -8,11 +13,6 @@ import { withTwoFactorClaim } from "../claim.mjs";
|
|
|
8
13
|
import "../constant.mjs";
|
|
9
14
|
import { TWO_FACTOR_ERROR_CODES } from "../error-code.mjs";
|
|
10
15
|
import { assertTwoFactorNotLocked, recordTwoFactorFailure, resetTwoFactorFailures, twoFactorIsOn, verifyTwoFactor } from "../verify-two-factor.mjs";
|
|
11
|
-
import { APIError, BASE_ERROR_CODES } from "@entro314labs/entro-auth-core/error";
|
|
12
|
-
import { createAuthEndpoint } from "@entro314labs/entro-auth-core/api";
|
|
13
|
-
import * as z from "zod";
|
|
14
|
-
import { createOTP } from "@better-auth/utils/otp";
|
|
15
|
-
import { base32 } from "@better-auth/utils/base32";
|
|
16
16
|
// src/plugins/two-factor/totp/index.ts
|
|
17
17
|
const BASE32_PREFIX = "base32:";
|
|
18
18
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { User } from "../../types/models.mjs";
|
|
2
2
|
import { InferOptionSchema } from "../../types/plugins.mjs";
|
|
3
|
+
import { EntroAuthPlugin, LiteralString } from "@entro314labs/entro-auth-core";
|
|
3
4
|
import "../../types/index.mjs";
|
|
4
5
|
import { BackupCodeOptions } from "./backup-codes/index.mjs";
|
|
5
6
|
import { OTPOptions } from "./otp/index.mjs";
|
|
6
7
|
import { schema } from "./schema.mjs";
|
|
7
8
|
import { TOTPOptions } from "./totp/index.mjs";
|
|
8
|
-
import { EntroAuthPlugin, LiteralString } from "@entro314labs/entro-auth-core";
|
|
9
9
|
export interface TwoFactorOptions {
|
|
10
10
|
/**
|
|
11
11
|
* Application Name
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { GenericEndpointContext } from "@entro314labs/entro-auth-core";
|
|
1
2
|
import "./claim.mjs";
|
|
2
3
|
import { TWO_FACTOR_ERROR_CODES } from "./error-code.mjs";
|
|
3
4
|
import { TwoFactorTable, UserWithTwoFactor } from "./types.mjs";
|
|
4
|
-
import { GenericEndpointContext } from "@entro314labs/entro-auth-core";
|
|
5
5
|
export declare function verifyTwoFactor(ctx: GenericEndpointContext): Promise<{
|
|
6
6
|
valid: (ctx: GenericEndpointContext) => Promise<{
|
|
7
7
|
token: string;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { createHMAC } from "@better-auth/utils/hmac";
|
|
2
|
+
import { APIError } from "@entro314labs/entro-auth-core/error";
|
|
1
3
|
import { getAuthoritativeSessionFromCtx } from "../../api/routes/session.mjs";
|
|
2
4
|
import { expireCookie, setSessionCookie } from "../../cookies/index.mjs";
|
|
3
5
|
import { generateRandomString } from "../../crypto/random.mjs";
|
|
@@ -5,8 +7,6 @@ import { parseUserOutput } from "../../db/schema.mjs";
|
|
|
5
7
|
import { TRUST_DEVICE_COOKIE_NAME, TWO_FACTOR_COOKIE_NAME } from "./constant.mjs";
|
|
6
8
|
import { TWO_FACTOR_ERROR_CODES } from "./error-code.mjs";
|
|
7
9
|
import { hasPasskey, passkeySecondFactorEnabled } from "./passkey.mjs";
|
|
8
|
-
import { APIError } from "@entro314labs/entro-auth-core/error";
|
|
9
|
-
import { createHMAC } from "@better-auth/utils/hmac";
|
|
10
10
|
// src/plugins/two-factor/verify-two-factor.ts
|
|
11
11
|
async function verifyTwoFactor(ctx) {
|
|
12
12
|
const invalid = (errorKey) => {
|
|
@@ -20,9 +20,9 @@ export declare const usernameClient: <O extends UsernameClientOptions = Username
|
|
|
20
20
|
signal: "$sessionSignal";
|
|
21
21
|
}[];
|
|
22
22
|
$ERROR_CODES: {
|
|
23
|
+
INVALID_USERNAME_OR_PASSWORD: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"INVALID_USERNAME_OR_PASSWORD">;
|
|
23
24
|
EMAIL_NOT_VERIFIED: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"EMAIL_NOT_VERIFIED">;
|
|
24
25
|
UNEXPECTED_ERROR: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"UNEXPECTED_ERROR">;
|
|
25
|
-
INVALID_USERNAME_OR_PASSWORD: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"INVALID_USERNAME_OR_PASSWORD">;
|
|
26
26
|
USERNAME_IS_ALREADY_TAKEN: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"USERNAME_IS_ALREADY_TAKEN">;
|
|
27
27
|
USERNAME_TOO_SHORT: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"USERNAME_TOO_SHORT">;
|
|
28
28
|
USERNAME_TOO_LONG: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"USERNAME_TOO_LONG">;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const USERNAME_ERROR_CODES: {
|
|
2
|
+
INVALID_USERNAME_OR_PASSWORD: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"INVALID_USERNAME_OR_PASSWORD">;
|
|
2
3
|
EMAIL_NOT_VERIFIED: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"EMAIL_NOT_VERIFIED">;
|
|
3
4
|
UNEXPECTED_ERROR: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"UNEXPECTED_ERROR">;
|
|
4
|
-
INVALID_USERNAME_OR_PASSWORD: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"INVALID_USERNAME_OR_PASSWORD">;
|
|
5
5
|
USERNAME_IS_ALREADY_TAKEN: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"USERNAME_IS_ALREADY_TAKEN">;
|
|
6
6
|
USERNAME_TOO_SHORT: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"USERNAME_TOO_SHORT">;
|
|
7
7
|
USERNAME_TOO_LONG: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"USERNAME_TOO_LONG">;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
1
2
|
import { InferOptionSchema } from "../../types/plugins.mjs";
|
|
2
3
|
import { UsernameSchema } from "./schema.mjs";
|
|
3
4
|
import { USERNAME_ERROR_CODES } from "./error-codes.mjs";
|
|
4
|
-
import * as z from "zod";
|
|
5
5
|
declare module "@entro314labs/entro-auth-core" {
|
|
6
6
|
interface EntroAuthPluginRegistry<AuthOptions, Options> {
|
|
7
7
|
username: {
|
|
@@ -260,14 +260,14 @@ declare const usernameImpl: <IncludeDisplayUsername extends boolean>(options: Us
|
|
|
260
260
|
unique: true;
|
|
261
261
|
returned: true;
|
|
262
262
|
transform: {
|
|
263
|
-
input(value: import("@entro314labs/entro-auth-core/db").DBPrimitive): string | number | boolean |
|
|
263
|
+
input(value: import("@entro314labs/entro-auth-core/db").DBPrimitive): string | number | boolean | unknown[] | Date | Record<string, unknown> | null | undefined;
|
|
264
264
|
};
|
|
265
265
|
};
|
|
266
266
|
displayUsername: {
|
|
267
267
|
type: "string";
|
|
268
268
|
required: false;
|
|
269
269
|
transform: {
|
|
270
|
-
input(value: import("@entro314labs/entro-auth-core/db").DBPrimitive): string | number | boolean |
|
|
270
|
+
input(value: import("@entro314labs/entro-auth-core/db").DBPrimitive): string | number | boolean | unknown[] | Date | Record<string, unknown> | null | undefined;
|
|
271
271
|
};
|
|
272
272
|
};
|
|
273
273
|
}, "username"> : {
|
|
@@ -278,14 +278,14 @@ declare const usernameImpl: <IncludeDisplayUsername extends boolean>(options: Us
|
|
|
278
278
|
unique: true;
|
|
279
279
|
returned: true;
|
|
280
280
|
transform: {
|
|
281
|
-
input(value: import("@entro314labs/entro-auth-core/db").DBPrimitive): string | number | boolean |
|
|
281
|
+
input(value: import("@entro314labs/entro-auth-core/db").DBPrimitive): string | number | boolean | unknown[] | Date | Record<string, unknown> | null | undefined;
|
|
282
282
|
};
|
|
283
283
|
};
|
|
284
284
|
displayUsername: {
|
|
285
285
|
type: "string";
|
|
286
286
|
required: false;
|
|
287
287
|
transform: {
|
|
288
|
-
input(value: import("@entro314labs/entro-auth-core/db").DBPrimitive): string | number | boolean |
|
|
288
|
+
input(value: import("@entro314labs/entro-auth-core/db").DBPrimitive): string | number | boolean | unknown[] | Date | Record<string, unknown> | null | undefined;
|
|
289
289
|
};
|
|
290
290
|
};
|
|
291
291
|
};
|
|
@@ -299,9 +299,9 @@ declare const usernameImpl: <IncludeDisplayUsername extends boolean>(options: Us
|
|
|
299
299
|
};
|
|
300
300
|
options: UsernameOptions | undefined;
|
|
301
301
|
$ERROR_CODES: {
|
|
302
|
+
INVALID_USERNAME_OR_PASSWORD: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"INVALID_USERNAME_OR_PASSWORD">;
|
|
302
303
|
EMAIL_NOT_VERIFIED: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"EMAIL_NOT_VERIFIED">;
|
|
303
304
|
UNEXPECTED_ERROR: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"UNEXPECTED_ERROR">;
|
|
304
|
-
INVALID_USERNAME_OR_PASSWORD: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"INVALID_USERNAME_OR_PASSWORD">;
|
|
305
305
|
USERNAME_IS_ALREADY_TAKEN: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"USERNAME_IS_ALREADY_TAKEN">;
|
|
306
306
|
USERNAME_TOO_SHORT: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"USERNAME_TOO_SHORT">;
|
|
307
307
|
USERNAME_TOO_LONG: import("@entro314labs/entro-auth-core/utils/error-codes").RawError<"USERNAME_TOO_LONG">;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { createAuthEndpoint, createAuthMiddleware } from "@entro314labs/entro-auth-core/api";
|
|
2
|
+
import { getCurrentAdapter } from "@entro314labs/entro-auth-core/context";
|
|
3
|
+
import { APIError, BASE_ERROR_CODES } from "@entro314labs/entro-auth-core/error";
|
|
4
|
+
import * as z from "zod";
|
|
1
5
|
import { createEmailVerificationToken } from "../../api/routes/email-verification.mjs";
|
|
2
6
|
import { setSessionCookie } from "../../cookies/index.mjs";
|
|
3
7
|
import { mergeSchema, parseUserOutput } from "../../db/schema.mjs";
|
|
@@ -5,10 +9,6 @@ import { assertPasswordNotTooLong } from "../../utils/password.mjs";
|
|
|
5
9
|
import { PACKAGE_VERSION } from "../../version.mjs";
|
|
6
10
|
import { USERNAME_ERROR_CODES } from "./error-codes.mjs";
|
|
7
11
|
import { getSchema } from "./schema.mjs";
|
|
8
|
-
import { getCurrentAdapter } from "@entro314labs/entro-auth-core/context";
|
|
9
|
-
import { APIError, BASE_ERROR_CODES } from "@entro314labs/entro-auth-core/error";
|
|
10
|
-
import { createAuthEndpoint, createAuthMiddleware } from "@entro314labs/entro-auth-core/api";
|
|
11
|
-
import * as z from "zod";
|
|
12
12
|
// src/plugins/username/index.ts
|
|
13
13
|
function defaultUsernameValidator(username) {
|
|
14
14
|
return /^[a-zA-Z0-9_.]+$/.test(username);
|
|
@@ -11,14 +11,14 @@ export declare const getSchema: <IncludeDisplayUsername extends boolean = true>(
|
|
|
11
11
|
unique: true;
|
|
12
12
|
returned: true;
|
|
13
13
|
transform: {
|
|
14
|
-
input(value: import("@entro314labs/entro-auth-core/db").DBPrimitive): string | number | boolean |
|
|
14
|
+
input(value: import("@entro314labs/entro-auth-core/db").DBPrimitive): string | number | boolean | unknown[] | Date | Record<string, unknown> | null | undefined;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
displayUsername: {
|
|
18
18
|
type: "string";
|
|
19
19
|
required: false;
|
|
20
20
|
transform: {
|
|
21
|
-
input(value: import("@entro314labs/entro-auth-core/db").DBPrimitive): string | number | boolean |
|
|
21
|
+
input(value: import("@entro314labs/entro-auth-core/db").DBPrimitive): string | number | boolean | unknown[] | Date | Record<string, unknown> | null | undefined;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
}, "username"> : {
|
|
@@ -29,14 +29,14 @@ export declare const getSchema: <IncludeDisplayUsername extends boolean = true>(
|
|
|
29
29
|
unique: true;
|
|
30
30
|
returned: true;
|
|
31
31
|
transform: {
|
|
32
|
-
input(value: import("@entro314labs/entro-auth-core/db").DBPrimitive): string | number | boolean |
|
|
32
|
+
input(value: import("@entro314labs/entro-auth-core/db").DBPrimitive): string | number | boolean | unknown[] | Date | Record<string, unknown> | null | undefined;
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
displayUsername: {
|
|
36
36
|
type: "string";
|
|
37
37
|
required: false;
|
|
38
38
|
transform: {
|
|
39
|
-
input(value: import("@entro314labs/entro-auth-core/db").DBPrimitive): string | number | boolean |
|
|
39
|
+
input(value: import("@entro314labs/entro-auth-core/db").DBPrimitive): string | number | boolean | unknown[] | Date | Record<string, unknown> | null | undefined;
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
};
|
package/dist/state.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GenericEndpointContext } from "@entro314labs/entro-auth-core";
|
|
2
|
-
import
|
|
3
|
-
import * as z from "zod";
|
|
2
|
+
import "@entro314labs/entro-auth-core/error";
|
|
4
3
|
import { getAuthStateVerificationIdentifier } from "@entro314labs/entro-auth-core/utils/state";
|
|
4
|
+
import * as z from "zod";
|
|
5
5
|
declare const stateDataSchema: z.ZodObject<{
|
|
6
6
|
callbackURL: z.ZodString;
|
|
7
7
|
codeVerifier: z.ZodString;
|
package/dist/state.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { EntroAuthError } from "@entro314labs/entro-auth-core/error";
|
|
2
|
+
import { getAuthStateVerificationIdentifier } from "@entro314labs/entro-auth-core/utils/state";
|
|
3
|
+
import * as z from "zod";
|
|
1
4
|
import { expireCookie } from "./cookies/index.mjs";
|
|
2
5
|
import { generateRandomString } from "./crypto/random.mjs";
|
|
3
6
|
import { symmetricDecrypt, symmetricEncrypt } from "./crypto/index.mjs";
|
|
4
7
|
import { deriveEncryptionKey } from "./crypto/purpose.mjs";
|
|
5
|
-
import { EntroAuthError } from "@entro314labs/entro-auth-core/error";
|
|
6
|
-
import * as z from "zod";
|
|
7
|
-
import { getAuthStateVerificationIdentifier } from "@entro314labs/entro-auth-core/utils/state";
|
|
8
8
|
// src/state.ts
|
|
9
9
|
const stateDataSchema = z.looseObject({
|
|
10
10
|
callbackURL: z.string(),
|
|
@@ -3,10 +3,10 @@ import { Auth } from "../types/auth.mjs";
|
|
|
3
3
|
import "../index.mjs";
|
|
4
4
|
import { setCookieToHeader } from "../cookies/cookie-utils.mjs";
|
|
5
5
|
import "../cookies/index.mjs";
|
|
6
|
-
import { getTestInstance } from "./test-instance.mjs";
|
|
7
|
-
import { EntroAuthClientOptions, EntroAuthOptions } from "@entro314labs/entro-auth-core";
|
|
8
6
|
import { IncomingMessage, ServerResponse, createServer } from "node:http";
|
|
9
7
|
import { AddressInfo } from "node:net";
|
|
8
|
+
import { EntroAuthClientOptions, EntroAuthOptions } from "@entro314labs/entro-auth-core";
|
|
9
|
+
import { getTestInstance } from "./test-instance.mjs";
|
|
10
10
|
/** A Node request handler that can be installed on an HTTP test listener. */
|
|
11
11
|
export type HttpTestRequestHandler = (req: IncomingMessage, res: ServerResponse) => unknown | Promise<unknown>;
|
|
12
12
|
/** A bound HTTP test listener whose request handler can be installed later. */
|
|
@@ -84,18 +84,18 @@ export declare function getHttpTestInstance<O extends Partial<EntroAuthOptions>,
|
|
|
84
84
|
onResponse: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
|
|
85
85
|
};
|
|
86
86
|
})[];
|
|
87
|
+
method: string;
|
|
88
|
+
window?: null | undefined;
|
|
89
|
+
redirect?: RequestRedirect | undefined;
|
|
90
|
+
mode?: RequestMode | undefined;
|
|
87
91
|
cache?: RequestCache | undefined;
|
|
88
92
|
credentials?: RequestCredentials;
|
|
89
93
|
integrity?: string | undefined;
|
|
90
94
|
keepalive?: boolean | undefined;
|
|
91
|
-
method: string;
|
|
92
|
-
mode?: RequestMode | undefined;
|
|
93
95
|
priority?: RequestPriority | undefined;
|
|
94
|
-
redirect?: RequestRedirect | undefined;
|
|
95
96
|
referrer?: string | undefined;
|
|
96
97
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
97
98
|
signal?: AbortSignal | null;
|
|
98
|
-
window?: null | undefined;
|
|
99
99
|
onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
|
|
100
100
|
hookOptions?: {
|
|
101
101
|
cloneResponse?: boolean;
|
|
@@ -119,7 +119,7 @@ export declare function getHttpTestInstance<O extends Partial<EntroAuthOptions>,
|
|
|
119
119
|
headers?: {} | {
|
|
120
120
|
[x: string]: string | undefined;
|
|
121
121
|
accept?: ((string & {}) | "application/json" | "text/plain" | "application/octet-stream") | undefined;
|
|
122
|
-
"content-type"?: ((string & {}) | "application/x-www-form-urlencoded" | "
|
|
122
|
+
"content-type"?: ((string & {}) | "application/json" | "application/x-www-form-urlencoded" | "text/plain" | "application/octet-stream" | "multipart/form-data") | undefined;
|
|
123
123
|
authorization?: ((string & {}) | `Bearer ${string}` | `Basic ${string}`) | undefined;
|
|
124
124
|
} | undefined;
|
|
125
125
|
body?: any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { createServer } from "node:http";
|
|
1
2
|
import { toNodeHandler } from "../integrations/node.mjs";
|
|
2
3
|
import { getTestInstance } from "./test-instance.mjs";
|
|
3
|
-
import { createServer } from "node:http";
|
|
4
4
|
// src/test-utils/http-test-instance.ts
|
|
5
5
|
const closeHttpServer = (server) => new Promise((resolve, reject) => {
|
|
6
6
|
server.close((error) => {
|
|
@@ -3,11 +3,11 @@ import { Auth } from "../types/auth.mjs";
|
|
|
3
3
|
import "../index.mjs";
|
|
4
4
|
import "../client/index.mjs";
|
|
5
5
|
import { AuthClient } from "../client/vanilla.mjs";
|
|
6
|
+
import { SuccessContext } from "@better-fetch/fetch";
|
|
7
|
+
import { Awaitable, EntroAuthClientOptions, EntroAuthOptions } from "@entro314labs/entro-auth-core";
|
|
6
8
|
import "../cookies/index.mjs";
|
|
7
9
|
import { setCookieToHeader } from "../cookies/cookie-utils.mjs";
|
|
8
10
|
import "../types/index.mjs";
|
|
9
|
-
import { Awaitable, EntroAuthClientOptions, EntroAuthOptions } from "@entro314labs/entro-auth-core";
|
|
10
|
-
import { SuccessContext } from "@better-fetch/fetch";
|
|
11
11
|
export declare function getTestInstance<O extends Partial<EntroAuthOptions>, C extends EntroAuthClientOptions>(options?: O | undefined, config?: {
|
|
12
12
|
clientOptions?: C;
|
|
13
13
|
port?: number;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
3
|
+
import { sql } from "kysely";
|
|
4
|
+
import { afterAll } from "vitest";
|
|
1
5
|
import { entroAuth } from "../auth/full.mjs";
|
|
2
6
|
import { createAuthClient } from "../client/vanilla.mjs";
|
|
3
7
|
import { parseSetCookieHeader, setCookieToHeader } from "../cookies/cookie-utils.mjs";
|
|
@@ -5,10 +9,6 @@ import { getAdapter } from "../db/adapter-kysely.mjs";
|
|
|
5
9
|
import { getMigrations } from "../db/get-migration.mjs";
|
|
6
10
|
import { bearer } from "../plugins/bearer/index.mjs";
|
|
7
11
|
import { getBaseURL, isDynamicBaseURLConfig } from "../utils/url.mjs";
|
|
8
|
-
import { sql } from "kysely";
|
|
9
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
10
|
-
import { createHash, randomUUID } from "node:crypto";
|
|
11
|
-
import { afterAll } from "vitest";
|
|
12
12
|
// src/test-utils/test-instance.ts
|
|
13
13
|
const cleanupSet = /* @__PURE__ */ new Set();
|
|
14
14
|
const currentUserContextStorage = new AsyncLocalStorage();
|
package/dist/types/adapter.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DBAdapter
|
|
2
|
-
export type { DBAdapter
|
|
1
|
+
import { DBAdapter, DBAdapterInstance, DBAdapterSchemaCreation, DBTransactionAdapter, JoinConfig, JoinOption, Where } from "@entro314labs/entro-auth-core/db/adapter";
|
|
2
|
+
export type { DBAdapter, DBAdapterInstance, DBAdapterSchemaCreation, DBTransactionAdapter, JoinConfig, JoinOption, Where };
|
package/dist/types/api.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PrettifyDeep, UnionToIntersection } from "./helper.mjs";
|
|
2
1
|
import { Endpoint } from "better-call";
|
|
2
|
+
import { PrettifyDeep, UnionToIntersection } from "./helper.mjs";
|
|
3
3
|
export type FilteredAPI<API> = Omit<API, API extends { [key in infer K]: Endpoint; } ? K extends string ? K extends "getSession" ? never : API[K]["options"]["metadata"] extends {
|
|
4
4
|
isAction: false;
|
|
5
5
|
} | {
|
package/dist/types/auth.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { AuthContext, EntroAuthOptions } from "@entro314labs/entro-auth-core";
|
|
2
|
+
import { BASE_ERROR_CODES } from "@entro314labs/entro-auth-core/error";
|
|
1
3
|
import { router } from "../api/index.mjs";
|
|
2
4
|
import { InferAPI } from "./api.mjs";
|
|
3
5
|
import { InferPluginTypes, Session, User } from "./models.mjs";
|
|
4
6
|
import { InferPluginContext, InferPluginErrorCodes } from "./plugins.mjs";
|
|
5
|
-
import { AuthContext, EntroAuthOptions } from "@entro314labs/entro-auth-core";
|
|
6
|
-
import { BASE_ERROR_CODES } from "@entro314labs/entro-auth-core/error";
|
|
7
7
|
export type Auth<Options extends EntroAuthOptions = EntroAuthOptions> = {
|
|
8
8
|
handler: (request: Request) => Promise<Response>;
|
|
9
9
|
/**
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EntroAuthAdvancedOptions, EntroAuthCookies, EntroAuthOptions, EntroAuthPlugin, EntroAuthRateLimitOptions, StoreIdentifierOption, UserProvisioningSource, ValidateUserInfoAction, ValidateUserInfoMethod, ValidateUserInfoOAuthInfo, ValidateUserInfoResult, ValidateUserInfoSSOInfo, ValidateUserInfoSource } from "@entro314labs/entro-auth-core";
|
|
1
2
|
import { ClientAtomListener, ClientStore, EntroAuthClientOptions, EntroAuthClientPlugin, InferActions, InferAdditionalFromClient, InferClientAPI, InferErrorCodes, InferSessionFromClient, InferUserFromClient, IsSignal, SessionQueryParams } from "../client/types.mjs";
|
|
2
3
|
import { DBAdapter, DBAdapterInstance, DBAdapterSchemaCreation, DBTransactionAdapter, JoinConfig, JoinOption, Where } from "./adapter.mjs";
|
|
3
4
|
import { FilteredAPI, InferAPI, InferSessionAPI } from "./api.mjs";
|
|
@@ -5,6 +6,5 @@ import { Auth } from "./auth.mjs";
|
|
|
5
6
|
import { ExtractPluginField, HasRequiredKeys, InferPluginFieldFromTuple, IsAny, OverrideMerge, Prettify, PrettifyDeep, RequiredKeysOf, StripEmptyObjects, UnionToIntersection } from "./helper.mjs";
|
|
6
7
|
import { Account, AdditionalSessionFieldsInput, AdditionalUserFieldsInput, InferPluginTypes, RateLimit, Session, User, Verification } from "./models.mjs";
|
|
7
8
|
import { InferOptionSchema, InferPluginContext, InferPluginErrorCodes, InferPluginIDs } from "./plugins.mjs";
|
|
8
|
-
import { EntroAuthAdvancedOptions, EntroAuthCookies, EntroAuthOptions, EntroAuthPlugin, EntroAuthRateLimitOptions, StoreIdentifierOption, UserProvisioningSource, ValidateUserInfoAction, ValidateUserInfoMethod, ValidateUserInfoOAuthInfo, ValidateUserInfoResult, ValidateUserInfoSSOInfo, ValidateUserInfoSource } from "@entro314labs/entro-auth-core";
|
|
9
9
|
export type * from "@entro314labs/entro-auth-core/social-providers";
|
|
10
10
|
export { type Account, type AdditionalSessionFieldsInput, type AdditionalUserFieldsInput, type Auth, type ClientAtomListener, type ClientStore, type DBAdapter, type DBAdapterInstance, type DBAdapterSchemaCreation, type DBTransactionAdapter, type EntroAuthAdvancedOptions, type EntroAuthClientOptions, type EntroAuthClientPlugin, type EntroAuthCookies, type EntroAuthOptions, type EntroAuthPlugin, type EntroAuthRateLimitOptions, type ExtractPluginField, FilteredAPI, type HasRequiredKeys, InferAPI, InferActions, InferAdditionalFromClient, InferClientAPI, InferErrorCodes, type InferOptionSchema, type InferPluginContext, type InferPluginErrorCodes, type InferPluginFieldFromTuple, type InferPluginIDs, type InferPluginTypes, InferSessionAPI, InferSessionFromClient, InferUserFromClient, type IsAny, IsSignal, type JoinConfig, type JoinOption, type OverrideMerge, type Prettify, type PrettifyDeep, type RateLimit, type RequiredKeysOf, type Session, SessionQueryParams, type StoreIdentifierOption, type StripEmptyObjects, type UnionToIntersection, type User, type UserProvisioningSource, type ValidateUserInfoAction, type ValidateUserInfoMethod, type ValidateUserInfoOAuthInfo, type ValidateUserInfoResult, type ValidateUserInfoSSOInfo, type ValidateUserInfoSource, type Verification, type Where };
|
package/dist/types/models.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ExtractPluginField, InferPluginFieldFromTuple, UnionToIntersection } from "./helper.mjs";
|
|
2
1
|
import { EntroAuthOptions } from "@entro314labs/entro-auth-core";
|
|
3
|
-
import { Account, InferDBFieldsFromOptionsInput, InferDBFieldsFromPluginsInput, RateLimit, Session
|
|
2
|
+
import { Account, InferDBFieldsFromOptionsInput, InferDBFieldsFromPluginsInput, RateLimit, Session, User, Verification } from "@entro314labs/entro-auth-core/db";
|
|
3
|
+
import { ExtractPluginField, InferPluginFieldFromTuple, UnionToIntersection } from "./helper.mjs";
|
|
4
4
|
export type AdditionalUserFieldsInput<Options extends EntroAuthOptions> = InferDBFieldsFromPluginsInput<"user", Options["plugins"]> & InferDBFieldsFromOptionsInput<Options["user"]>;
|
|
5
5
|
export type AdditionalSessionFieldsInput<Options extends EntroAuthOptions> = InferDBFieldsFromPluginsInput<"session", Options["plugins"]> & InferDBFieldsFromOptionsInput<Options["session"]>;
|
|
6
6
|
export type InferPluginTypes<O extends EntroAuthOptions> = O["plugins"] extends readonly [unknown, ...unknown[]] ? InferPluginFieldFromTuple<O["plugins"], "$Infer"> : O["plugins"] extends Array<infer P> ? UnionToIntersection<ExtractPluginField<P, "$Infer">> : {};
|
|
7
|
-
export type { Account, RateLimit, Session
|
|
7
|
+
export type { Account, RateLimit, Session, User, Verification };
|
package/dist/types/plugins.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ExtractPluginField, InferPluginFieldFromTuple, UnionToIntersection } from "./helper.mjs";
|
|
2
1
|
import { AuthContext, EntroAuthOptions, EntroAuthPlugin } from "@entro314labs/entro-auth-core";
|
|
3
2
|
import { EntroAuthPluginDBSchema } from "@entro314labs/entro-auth-core/db";
|
|
3
|
+
import { ExtractPluginField, InferPluginFieldFromTuple, UnionToIntersection } from "./helper.mjs";
|
|
4
4
|
export type InferOptionSchema<S extends EntroAuthPluginDBSchema> = S extends Record<string, {
|
|
5
5
|
fields: infer Fields;
|
|
6
6
|
}> ? { [K in keyof S]?: {
|
package/dist/utils/hashing.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { utf8ToBytes } from "@noble/hashes/utils.js";
|
|
2
1
|
import { keccak_256 } from "@noble/hashes/sha3.js";
|
|
2
|
+
import { utf8ToBytes } from "@noble/hashes/utils.js";
|
|
3
3
|
// src/utils/hashing.ts
|
|
4
4
|
/**
|
|
5
5
|
* TS implementation of ERC-55 ("Mixed-case checksum address encoding") using @noble/hashes
|
package/dist/utils/url.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { wildcardMatch } from "./wildcard.mjs";
|
|
2
1
|
import { env } from "@entro314labs/entro-auth-core/env";
|
|
3
2
|
import { EntroAuthError } from "@entro314labs/entro-auth-core/error";
|
|
3
|
+
import { wildcardMatch } from "./wildcard.mjs";
|
|
4
4
|
// src/utils/url.ts
|
|
5
5
|
const SLASH_CHAR_CODE = "/".charCodeAt(0);
|
|
6
6
|
/**
|
package/dist/version.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entro314labs/entro-auth",
|
|
3
|
-
"version": "1.8.0-beta.
|
|
3
|
+
"version": "1.8.0-beta.13",
|
|
4
4
|
"description": "The most comprehensive authentication framework for TypeScript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -485,47 +485,47 @@
|
|
|
485
485
|
}
|
|
486
486
|
},
|
|
487
487
|
"dependencies": {
|
|
488
|
-
"@entro314labs/entro-auth-core": "1.8.0-beta.
|
|
489
|
-
"@entro314labs/entro-auth-drizzle-adapter": "1.8.0-beta.
|
|
490
|
-
"@entro314labs/entro-auth-kysely-adapter": "1.8.0-beta.
|
|
491
|
-
"@entro314labs/entro-auth-memory-adapter": "1.8.0-beta.
|
|
488
|
+
"@entro314labs/entro-auth-core": "1.8.0-beta.13",
|
|
489
|
+
"@entro314labs/entro-auth-drizzle-adapter": "1.8.0-beta.13",
|
|
490
|
+
"@entro314labs/entro-auth-kysely-adapter": "1.8.0-beta.13",
|
|
491
|
+
"@entro314labs/entro-auth-memory-adapter": "1.8.0-beta.13",
|
|
492
492
|
"@better-auth/utils": "0.5.1",
|
|
493
493
|
"@better-fetch/fetch": "1.3.3",
|
|
494
|
-
"@noble/ciphers": "^2.
|
|
495
|
-
"@noble/hashes": "^2.
|
|
494
|
+
"@noble/ciphers": "^2.4.0",
|
|
495
|
+
"@noble/hashes": "^2.4.0",
|
|
496
496
|
"better-call": "1.4.6",
|
|
497
|
-
"defu": "^6.1.
|
|
498
|
-
"jose": "^6.2.
|
|
499
|
-
"kysely": "^0.28.17 || ^0.29.
|
|
500
|
-
"nanostores": "^1.
|
|
497
|
+
"defu": "^6.1.7",
|
|
498
|
+
"jose": "^6.2.18",
|
|
499
|
+
"kysely": "^0.28.17 || ^0.29.9",
|
|
500
|
+
"nanostores": "^1.5.5",
|
|
501
501
|
"zod": "^4.5.4"
|
|
502
502
|
},
|
|
503
503
|
"devDependencies": {
|
|
504
|
-
"@lynx-js/react": "^0.
|
|
505
|
-
"@opentelemetry/api": "^1.
|
|
506
|
-
"@opentelemetry/sdk-trace-base": "^2.
|
|
507
|
-
"@opentelemetry/sdk-trace-node": "^2.
|
|
508
|
-
"@sveltejs/kit": "^3.
|
|
509
|
-
"@tanstack/react-start": "^1.
|
|
510
|
-
"@tanstack/solid-start": "^1.
|
|
511
|
-
"@types/bun": "^1.
|
|
504
|
+
"@lynx-js/react": "^0.129.4",
|
|
505
|
+
"@opentelemetry/api": "^1.10.0",
|
|
506
|
+
"@opentelemetry/sdk-trace-base": "^2.12.0",
|
|
507
|
+
"@opentelemetry/sdk-trace-node": "^2.12.0",
|
|
508
|
+
"@sveltejs/kit": "^3.4.0",
|
|
509
|
+
"@tanstack/react-start": "^1.169.7",
|
|
510
|
+
"@tanstack/solid-start": "^1.169.7",
|
|
511
|
+
"@types/bun": "^1.4.5",
|
|
512
512
|
"@types/google.accounts": "^0.0.18",
|
|
513
|
-
"@types/pg": "^8.
|
|
514
|
-
"@types/react": "^19.
|
|
515
|
-
"@types/react-dom": "^19.
|
|
516
|
-
"botid": "^1.5.
|
|
513
|
+
"@types/pg": "^8.23.1",
|
|
514
|
+
"@types/react": "^19.3.1",
|
|
515
|
+
"@types/react-dom": "^19.3.0",
|
|
516
|
+
"botid": "^1.5.13",
|
|
517
517
|
"happy-dom": "^21.0.4",
|
|
518
|
-
"msw": "^
|
|
518
|
+
"msw": "^3.0.7",
|
|
519
519
|
"next": "^16.4.6",
|
|
520
|
-
"oauth2-mock-server": "^9.
|
|
520
|
+
"oauth2-mock-server": "^9.3.0",
|
|
521
521
|
"react": "^19.3.1",
|
|
522
522
|
"react-dom": "^19.3.1",
|
|
523
523
|
"solid-js": "^1.9.11",
|
|
524
|
-
"tsdown": "0.23.
|
|
524
|
+
"tsdown": "0.23.7",
|
|
525
525
|
"type-fest": "^5.7.0",
|
|
526
526
|
"typescript": "^6.0.3",
|
|
527
|
-
"vitest": "^5.1.
|
|
528
|
-
"vue": "^3.5.
|
|
527
|
+
"vitest": "^5.1.1",
|
|
528
|
+
"vue": "^3.5.46"
|
|
529
529
|
},
|
|
530
530
|
"peerDependencies": {
|
|
531
531
|
"@lynx-js/react": "*",
|