@xk2800/nextjs-template 0.7.2-beta.2 → 0.7.2-beta.3

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,7 +1,7 @@
1
1
  import { unexpectedErrorMessage } from '../chunk-653GF7OT.mjs';
2
2
  import { MARKETING_SEGMENT_ID, setSubscribed } from '../chunk-NQELV53D.mjs';
3
- import { hasRole } from '../chunk-VVXYKVFJ.mjs';
4
- import { auth } from '../chunk-K2GCSLRJ.mjs';
3
+ import { hasRole } from '../chunk-YHQ4A5RF.mjs';
4
+ import { auth } from '../chunk-ONJDPUVO.mjs';
5
5
  import '../chunk-O5EQYHNC.mjs';
6
6
  import '../chunk-6OAHCEDJ.mjs';
7
7
  import '../chunk-2BJ3B4FR.mjs';
@@ -27,8 +27,8 @@ declare const getCurrentSession: () => Promise<{
27
27
  image?: string | null | undefined | undefined;
28
28
  role: string | null | undefined;
29
29
  banned: boolean | null | undefined;
30
- banExpires?: Date | null | undefined;
31
30
  banReason?: string | null | undefined;
31
+ banExpires?: Date | null | undefined;
32
32
  twoFactorEnabled: boolean | null | undefined;
33
33
  };
34
34
  } | null>;
@@ -61,8 +61,8 @@ declare const requireAuth: () => Promise<{
61
61
  image?: string | null | undefined | undefined;
62
62
  role: string | null | undefined;
63
63
  banned: boolean | null | undefined;
64
- banExpires?: Date | null | undefined;
65
64
  banReason?: string | null | undefined;
65
+ banExpires?: Date | null | undefined;
66
66
  twoFactorEnabled: boolean | null | undefined;
67
67
  };
68
68
  }>;
@@ -95,8 +95,8 @@ declare function requireRole(requiredRole: 'user' | 'admin'): Promise<{
95
95
  image?: string | null | undefined | undefined;
96
96
  role: string | null | undefined;
97
97
  banned: boolean | null | undefined;
98
- banExpires?: Date | null | undefined;
99
98
  banReason?: string | null | undefined;
99
+ banExpires?: Date | null | undefined;
100
100
  twoFactorEnabled: boolean | null | undefined;
101
101
  };
102
102
  }>;
@@ -27,8 +27,8 @@ declare const getCurrentSession: () => Promise<{
27
27
  image?: string | null | undefined | undefined;
28
28
  role: string | null | undefined;
29
29
  banned: boolean | null | undefined;
30
- banExpires?: Date | null | undefined;
31
30
  banReason?: string | null | undefined;
31
+ banExpires?: Date | null | undefined;
32
32
  twoFactorEnabled: boolean | null | undefined;
33
33
  };
34
34
  } | null>;
@@ -61,8 +61,8 @@ declare const requireAuth: () => Promise<{
61
61
  image?: string | null | undefined | undefined;
62
62
  role: string | null | undefined;
63
63
  banned: boolean | null | undefined;
64
- banExpires?: Date | null | undefined;
65
64
  banReason?: string | null | undefined;
65
+ banExpires?: Date | null | undefined;
66
66
  twoFactorEnabled: boolean | null | undefined;
67
67
  };
68
68
  }>;
@@ -95,8 +95,8 @@ declare function requireRole(requiredRole: 'user' | 'admin'): Promise<{
95
95
  image?: string | null | undefined | undefined;
96
96
  role: string | null | undefined;
97
97
  banned: boolean | null | undefined;
98
- banExpires?: Date | null | undefined;
99
98
  banReason?: string | null | undefined;
99
+ banExpires?: Date | null | undefined;
100
100
  twoFactorEnabled: boolean | null | undefined;
101
101
  };
102
102
  }>;
@@ -1246,6 +1246,7 @@ async function promoteFirstAdmin(user) {
1246
1246
  const [existing] = await db.select({ id: users.id }).from(users).where(drizzleOrm.eq(users.role, "admin")).limit(1);
1247
1247
  if (existing) return;
1248
1248
  await db.update(users).set({ role: "admin" }).where(drizzleOrm.eq(users.id, user.id));
1249
+ user.role = "admin";
1249
1250
  }
1250
1251
  function createAuth(overrides = {}) {
1251
1252
  var _a, _b, _c, _d, _e, _f, _g;