Fixing the way we generate the backenduser object during jwt creation
diff --git a/website/src/pages/api/auth/[...nextauth].ts b/website/src/pages/api/auth/[...nextauth].ts
index d56868f839..d75422a40d 100644
--- a/website/src/pages/api/auth/[...nextauth].ts
+++ b/website/src/pages/api/auth/[...nextauth].ts
@@ -112,8 +112,9 @@ const authOptions: AuthOptions = {
         select: { name: true, role: true, isNew: true, accounts: true, id: true },
       });
 
+      // Note: This could be cleaner and merged with src/lib/users.ts
       const user: BackendUserCore = {
-        id,
+        id: accounts.length > 0 ? accounts[0].providerAccountId : id,
         display_name: name,
         auth_method: accounts.length > 0 ? accounts[0].provider : "local",
       };
