@absolutejs/auth 0.48.6 → 0.49.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.
@@ -1180,10 +1180,10 @@ var providers = defineProviders({
1180
1180
  isOIDC: false,
1181
1181
  isRefreshable: true,
1182
1182
  profileRequest: {
1183
- authIn: "header",
1183
+ authIn: "path",
1184
1184
  encoding: "application/json",
1185
1185
  method: "GET",
1186
- url: "https://api.hubapi.com/oauth/v1/access-tokens/me"
1186
+ url: "https://api.hubapi.com/oauth/v1/access-tokens"
1187
1187
  },
1188
1188
  scopeRequired: true,
1189
1189
  subject: ["hub_id"],
@@ -2451,14 +2451,23 @@ import {
2451
2451
  boolean as boolean3,
2452
2452
  jsonb as jsonb3,
2453
2453
  pgTable as pgTable8,
2454
+ smallint,
2454
2455
  text as text4,
2455
2456
  varchar as varchar8
2456
2457
  } from "drizzle-orm/pg-core";
2457
2458
  var ID_LENGTH6 = 255;
2459
+ var PHONE_LENGTH = 20;
2458
2460
  var mfaEnrollmentsTable = pgTable8("auth_mfa_enrollments", {
2459
2461
  backup_code_hashes: jsonb3("backup_code_hashes").$type().notNull().default([]),
2460
2462
  created_at_ms: bigint6("created_at_ms", { mode: "number" }).notNull(),
2461
2463
  last_used_at_ms: bigint6("last_used_at_ms", { mode: "number" }),
2464
+ sms_failed_attempts: smallint("sms_failed_attempts").notNull().default(0),
2465
+ sms_pending_code_expires_at_ms: bigint6("sms_pending_code_expires_at_ms", {
2466
+ mode: "number"
2467
+ }),
2468
+ sms_pending_code_hash: text4("sms_pending_code_hash"),
2469
+ sms_phone: varchar8("sms_phone", { length: PHONE_LENGTH }),
2470
+ sms_verified: boolean3("sms_verified").notNull().default(false),
2462
2471
  totp_secret_ciphertext: text4("totp_secret_ciphertext"),
2463
2472
  totp_verified: boolean3("totp_verified").notNull().default(false),
2464
2473
  updated_at_ms: bigint6("updated_at_ms", { mode: "number" }).notNull(),
@@ -2963,6 +2972,17 @@ var initMigration = (block, tables) => ({
2963
2972
  block,
2964
2973
  migrations: [{ id: "0001_init", sql: tablesToInitSql(tables) }]
2965
2974
  });
2975
+ var mfaSmsColumnsMigration = {
2976
+ id: "0002_sms_factor",
2977
+ sql: [
2978
+ 'ALTER TABLE "auth_mfa_enrollments" ADD COLUMN IF NOT EXISTS "sms_phone" varchar(20);',
2979
+ 'ALTER TABLE "auth_mfa_enrollments" ADD COLUMN IF NOT EXISTS "sms_verified" boolean NOT NULL DEFAULT false;',
2980
+ 'ALTER TABLE "auth_mfa_enrollments" ADD COLUMN IF NOT EXISTS "sms_pending_code_hash" text;',
2981
+ 'ALTER TABLE "auth_mfa_enrollments" ADD COLUMN IF NOT EXISTS "sms_pending_code_expires_at_ms" bigint;',
2982
+ 'ALTER TABLE "auth_mfa_enrollments" ADD COLUMN IF NOT EXISTS "sms_failed_attempts" smallint NOT NULL DEFAULT 0;'
2983
+ ].join(`
2984
+ `)
2985
+ };
2966
2986
  var blockMigrations = {
2967
2987
  adaptive: initMigration("adaptive", [knownDevicesTable, loginHistoryTable]),
2968
2988
  apikeys: initMigration("apikeys", [
@@ -2982,7 +3002,13 @@ var blockMigrations = {
2982
3002
  linkedProviderGrantsTable
2983
3003
  ]),
2984
3004
  lockout: initMigration("lockout", [lockoutsTable]),
2985
- mfa: initMigration("mfa", [mfaEnrollmentsTable]),
3005
+ mfa: {
3006
+ block: "mfa",
3007
+ migrations: [
3008
+ ...initMigration("mfa", [mfaEnrollmentsTable]).migrations,
3009
+ mfaSmsColumnsMigration
3010
+ ]
3011
+ },
2986
3012
  oidc: initMigration("oidc", [
2987
3013
  oauthBackchannelAuthRequestsTable,
2988
3014
  oauthClientAssertionJtisTable,
@@ -3186,5 +3212,5 @@ var main = async () => {
3186
3212
  };
3187
3213
  await main();
3188
3214
 
3189
- //# debugId=E26FF9BDE963CA5264756E2164756E21
3215
+ //# debugId=52C0F4B126AC1D9D64756E2164756E21
3190
3216
  //# sourceMappingURL=migrate.js.map