mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-20 05:28:22 +02:00
Improve user creation process with better error logging and testing
Add detailed logging and a test script to diagnose and fix user creation failures in production. Replit-Commit-Author: Agent Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/AwxJU6M
This commit is contained in:
1 parent
7235be8b84
commit
b886f317ca
5 files changed
+198
-16
No files matched your search
+18
-9
@@ -296,15 +296,24 @@ export class DatabaseStorage implements IStorage {
|
||||
}
|
||||
|
||||
async createUser(userData: UpsertUser): Promise<User> {
|
||||
const [user] = await db
|
||||
.insert(users)
|
||||
.values({
|
||||
...userData,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
})
|
||||
.returning();
|
||||
return user;
|
||||
console.log('🔍 Storage createUser called with:', userData.username);
|
||||
try {
|
||||
const [user] = await db
|
||||
.insert(users)
|
||||
.values({
|
||||
...userData,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
})
|
||||
.returning();
|
||||
console.log('✅ Storage createUser successful:', user.username);
|
||||
return user;
|
||||
} catch (error) {
|
||||
console.error('❌ Storage createUser error:', error);
|
||||
console.error('❌ Storage error code:', error.code);
|
||||
console.error('❌ Storage error constraint:', error.constraint);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async updateUser(id: string, userData: Partial<UpsertUser>): Promise<User> {
|
||||
|
||||
Reference in new issue
Block a user