Index: app/(app)/profile/actions.ts
===================================================================
--- app/(app)/profile/actions.ts	(revision 509bd1945ebde55993c693195b3a5c8518ddc204)
+++ app/(app)/profile/actions.ts	(revision f20977e9ce332fa167b0afc1e9415dcfc0a4f09a)
@@ -10,4 +10,10 @@
 export async function updateProfile(formData: FormData) {
     const session = await auth();
+
+    const userId = Number(session?.user?.id);
+    if (!Number.isInteger(userId)) {
+        throw new Error('Invalid user ID in session');
+    }
+
     if (!session?.user?.id) redirect('/login');
 
@@ -19,5 +25,5 @@
         SET user_name = ${name},
             email = ${email}
-        WHERE user_id = ${session.user.id}
+        WHERE user_id = ${userId}
     `;
 
@@ -27,4 +33,10 @@
 export async function updatePassword(formData: FormData) {
     const session = await auth();
+
+    const userId = Number(session?.user?.id);
+    if (!Number.isInteger(userId)) {
+        throw new Error('Invalid user ID in session');
+    }
+
     if (!session?.user?.id) redirect('/login');
 
@@ -35,5 +47,5 @@
         SELECT password
         FROM "user"
-        WHERE user_id = ${session.user.id}
+        WHERE user_id = ${userId}
     `;
 
@@ -51,5 +63,5 @@
         UPDATE "user"
         SET password = ${hashed}
-        WHERE user_id = ${session.user.id}
+        WHERE user_id = ${userId}
     `;
 
Index: app/lib/definitions.ts
===================================================================
--- app/lib/definitions.ts	(revision 509bd1945ebde55993c693195b3a5c8518ddc204)
+++ app/lib/definitions.ts	(revision f20977e9ce332fa167b0afc1e9415dcfc0a4f09a)
@@ -3,6 +3,6 @@
 
 export type User = {
-  id: string;
-  name: string;
+  user_id: number;
+  user_name: string;
   email: string;
   password: string;
Index: auth.d.ts
===================================================================
--- auth.d.ts	(revision 509bd1945ebde55993c693195b3a5c8518ddc204)
+++ auth.d.ts	(revision f20977e9ce332fa167b0afc1e9415dcfc0a4f09a)
@@ -1,17 +1,9 @@
-import NextAuth from 'next-auth';
-
 declare module 'next-auth' {
     interface Session {
         user: {
-            id: string;
+            id: string; // stringified integer
             name: string;
             email: string;
         };
-    }
-
-    interface User {
-        id: string;
-        name: string;
-        email: string;
     }
 
Index: auth.ts
===================================================================
--- auth.ts	(revision 509bd1945ebde55993c693195b3a5c8518ddc204)
+++ auth.ts	(revision f20977e9ce332fa167b0afc1e9415dcfc0a4f09a)
@@ -37,6 +37,6 @@
                     if (passwordsMatch) {
                         return {
-                            id: user.id,
-                            name: user.name,
+                            id: String(user.user_id),
+                            name: user.user_name,
                             email: user.email,
                         };
