@absolutejs/auth 0.49.2 → 0.50.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.
@@ -1,6 +1,6 @@
1
1
  import { Elysia } from 'elysia';
2
2
  import { type MfaRouteProps } from './config';
3
- export declare const mfaChallenge: <UserType>({ authSessionStore, challengeRoute, cookieSecure, encryptionKey, getChallengeUser, getUserId, mfaStore, onMfaChallengeError, onMfaChallengeSuccess, onSendSmsCode, sessionDurationMs, smsCodeLength, smsCodeTtlMs, smsMaxAttempts }: MfaRouteProps<UserType>) => Elysia<"", {
3
+ export declare const mfaChallenge: <UserType>({ authSessionStore, challengeRoute, cookieSecure, encryptionKey, getChallengeUser, getUserId, mfaStore, onMfaChallengeError, onMfaChallengeSuccess, onSendSmsCode, sessionDurationMs, smsCodeLength, smsCodeTtlMs, smsMaxAttempts, totpMaxAttempts }: MfaRouteProps<UserType>) => Elysia<"", {
4
4
  decorator: {};
5
5
  store: {
6
6
  session: import("..").SessionRecord<UserType>;
@@ -7,6 +7,7 @@ export declare const DEFAULT_MFA_SESSION_TTL_MS: number;
7
7
  export declare const DEFAULT_SMS_CODE_LENGTH = 6;
8
8
  export declare const DEFAULT_SMS_CODE_TTL_MS: number;
9
9
  export declare const DEFAULT_SMS_MAX_ATTEMPTS = 3;
10
+ export declare const DEFAULT_TOTP_MAX_ATTEMPTS = 5;
10
11
  export type SmsCodeMessage = {
11
12
  code: string;
12
13
  expiresAt: number;
@@ -38,6 +39,7 @@ export type MfaConfig<UserType> = {
38
39
  smsMaxAttempts?: number;
39
40
  smsSetupRoute?: RouteString;
40
41
  smsVerifyRoute?: RouteString;
42
+ totpMaxAttempts?: number;
41
43
  totpSetupRoute?: RouteString;
42
44
  totpVerifyRoute?: RouteString;
43
45
  };
@@ -124,6 +124,21 @@ export declare const mfaEnrollmentsTable: import("drizzle-orm/pg-core").PgTableW
124
124
  identity: undefined;
125
125
  generated: undefined;
126
126
  }>;
127
+ totp_failed_attempts: import("drizzle-orm/pg-core").PgBuildColumn<"auth_mfa_enrollments", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgSmallIntBuilder>>, {
128
+ name: string;
129
+ tableName: "auth_mfa_enrollments";
130
+ dataType: "number int16";
131
+ data: number;
132
+ driverParam: string | number;
133
+ notNull: true;
134
+ hasDefault: true;
135
+ isPrimaryKey: false;
136
+ isAutoincrement: false;
137
+ hasRuntimeDefault: false;
138
+ enumValues: undefined;
139
+ identity: undefined;
140
+ generated: undefined;
141
+ }>;
127
142
  totp_secret_ciphertext: import("drizzle-orm/pg-core").PgBuildColumn<"auth_mfa_enrollments", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
128
143
  name: string;
129
144
  tableName: "auth_mfa_enrollments";
@@ -8,6 +8,7 @@ export type MfaEnrollment = {
8
8
  smsPendingCodeExpiresAt?: number;
9
9
  smsPhone?: string;
10
10
  smsVerified: boolean;
11
+ totpFailedAttempts?: number;
11
12
  totpSecretCiphertext?: string;
12
13
  totpVerified: boolean;
13
14
  updatedAt: number;
@@ -750,7 +750,10 @@ var providers = defineProviders({
750
750
  url: "https://services.leadconnectorhq.com/users/me"
751
751
  },
752
752
  scopeRequired: true,
753
- subject: ["id"],
753
+ subject: ["locationId"],
754
+ subjectBySource: {
755
+ tokenResponse: ["locationId"]
756
+ },
754
757
  subjectType: "string",
755
758
  tokenRequest: {
756
759
  authIn: "body",
@@ -2613,5 +2616,5 @@ export {
2613
2616
  decodeJWT
2614
2617
  };
2615
2618
 
2616
- //# debugId=F2F52E55182F339764756E2164756E21
2619
+ //# debugId=FE819E5206EE2BED64756E2164756E21
2617
2620
  //# sourceMappingURL=index.js.map