@lastbrain/module-auth 0.1.4 → 0.1.5

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 +1 @@
1
- {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../src/api/admin/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGxD;;;;;GAKG;AACH,wBAAsB,GAAG,CAAC,OAAO,EAAE,WAAW,8BAyC7C"}
1
+ {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../src/api/admin/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGxD;;;;;GAKG;AACH,wBAAsB,GAAG,CAAC,OAAO,EAAE,WAAW,8BA8C7C"}
@@ -26,7 +26,10 @@ export async function GET(request) {
26
26
  return NextResponse.json({ error: "Database Error", message: usersError.message }, { status: 500 });
27
27
  }
28
28
  // The RPC function returns the complete response with data and pagination
29
- return NextResponse.json(result || { data: [], pagination: { page, per_page: perPage, total: 0, total_pages: 0 } });
29
+ return NextResponse.json(result || {
30
+ data: [],
31
+ pagination: { page, per_page: perPage, total: 0, total_pages: 0 },
32
+ });
30
33
  }
31
34
  catch (error) {
32
35
  console.error("Error in admin users endpoint:", error);
@@ -1 +1 @@
1
- {"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../../src/api/auth/me.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C;;;GAGG;AACH,wBAAsB,GAAG;;;;;;;;;;IA+BxB"}
1
+ {"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../../src/api/auth/me.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C;;;GAGG;AACH,wBAAsB,GAAG;;;;;;;;;;IAiCxB"}
@@ -8,7 +8,7 @@ export async function GET() {
8
8
  try {
9
9
  const supabase = await getSupabaseServerClient();
10
10
  // Get the authenticated user
11
- const { data: { user } } = await supabase.auth.getUser();
11
+ const { data: { user }, } = await supabase.auth.getUser();
12
12
  // L'utilisateur est déjà authentifié grâce au middleware
13
13
  // Get user profile
14
14
  const { data: profile } = await supabase
@@ -88,7 +88,7 @@ const authBuildConfig = {
88
88
  files: [
89
89
  "20251112000000_user_init.sql",
90
90
  "20251112000001_auto_profile_and_admin_view.sql",
91
- "20251112000002_sync_avatars.sql"
91
+ "20251112000002_sync_avatars.sql",
92
92
  ],
93
93
  migrationsDownPath: "supabase/migrations-down",
94
94
  },
@@ -1 +1 @@
1
- {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../src/web/auth/profile.tsx"],"names":[],"mappings":"AAyCA,wBAAgB,WAAW,4CA4X1B"}
1
+ {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../src/web/auth/profile.tsx"],"names":[],"mappings":"AAyCA,wBAAgB,WAAW,4CA6X1B"}
@@ -10,6 +10,7 @@ export function ProfilePage() {
10
10
  const [isLoading, setIsLoading] = useState(true);
11
11
  const [isSaving, setIsSaving] = useState(false);
12
12
  const [_error, setError] = useState(null);
13
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
14
  const [currentUser, setCurrentUser] = useState(null);
14
15
  useEffect(() => {
15
16
  fetchProfile();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lastbrain/module-auth",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Module d'authentification complet pour LastBrain avec Supabase",
5
5
  "private": false,
6
6
  "type": "module",
@@ -25,7 +25,7 @@ export async function GET(request: NextRequest) {
25
25
  page_number: page,
26
26
  page_size: perPage,
27
27
  search_term: search,
28
- }
28
+ },
29
29
  );
30
30
 
31
31
  if (usersError) {
@@ -37,7 +37,12 @@ export async function GET(request: NextRequest) {
37
37
  }
38
38
 
39
39
  // The RPC function returns the complete response with data and pagination
40
- return NextResponse.json(result || { data: [], pagination: { page, per_page: perPage, total: 0, total_pages: 0 } });
40
+ return NextResponse.json(
41
+ result || {
42
+ data: [],
43
+ pagination: { page, per_page: perPage, total: 0, total_pages: 0 },
44
+ },
45
+ );
41
46
  } catch (error) {
42
47
  console.error("Error in admin users endpoint:", error);
43
48
  return NextResponse.json(
@@ -10,7 +10,9 @@ export async function GET() {
10
10
  const supabase = await getSupabaseServerClient();
11
11
 
12
12
  // Get the authenticated user
13
- const { data: { user } } = await supabase.auth.getUser();
13
+ const {
14
+ data: { user },
15
+ } = await supabase.auth.getUser();
14
16
 
15
17
  // L'utilisateur est déjà authentifié grâce au middleware
16
18
  // Get user profile
@@ -88,9 +88,9 @@ const authBuildConfig: ModuleBuildConfig = {
88
88
  priority: 20,
89
89
  path: "supabase/migrations",
90
90
  files: [
91
- "20251112000000_user_init.sql",
91
+ "20251112000000_user_init.sql",
92
92
  "20251112000001_auto_profile_and_admin_view.sql",
93
- "20251112000002_sync_avatars.sql"
93
+ "20251112000002_sync_avatars.sql",
94
94
  ],
95
95
  migrationsDownPath: "supabase/migrations-down",
96
96
  },
@@ -30,7 +30,7 @@ interface User {
30
30
  role?: string;
31
31
  full_name?: string;
32
32
  avatar_path?: string;
33
- metadata?: Record<string, any>;
33
+ metadata?: Record<string, unknown>;
34
34
  profile: {
35
35
  first_name?: string;
36
36
  last_name?: string;
@@ -195,7 +195,7 @@ export function DashboardPage() {
195
195
  <p className="text-2xl font-bold text-secondary">
196
196
  {Math.floor(
197
197
  (Date.now() - new Date(userData.created_at).getTime()) /
198
- (1000 * 60 * 60 * 24)
198
+ (1000 * 60 * 60 * 24),
199
199
  )}
200
200
  </p>
201
201
  <p className="text-small text-default-500">Days active</p>
@@ -44,6 +44,7 @@ export function ProfilePage() {
44
44
  const [isLoading, setIsLoading] = useState(true);
45
45
  const [isSaving, setIsSaving] = useState(false);
46
46
  const [_error, setError] = useState<string | null>(null);
47
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
47
48
  const [currentUser, setCurrentUser] = useState<any>(null);
48
49
 
49
50
  useEffect(() => {
@@ -145,19 +146,19 @@ export function ProfilePage() {
145
146
  "avatar",
146
147
  `${currentUser.id}_32_${version}.webp`,
147
148
  files.small,
148
- "image/webp"
149
+ "image/webp",
149
150
  );
150
151
  urls.medium = await uploadFile(
151
152
  "avatar",
152
153
  `${currentUser.id}_64_${version}.webp`,
153
154
  files.medium,
154
- "image/webp"
155
+ "image/webp",
155
156
  );
156
157
  urls.large = await uploadFile(
157
158
  "avatar",
158
159
  `${currentUser.id}_128_${version}.webp`,
159
160
  files.large,
160
- "image/webp"
161
+ "image/webp",
161
162
  );
162
163
 
163
164
  // Update user metadata