add DashboardMessages component for real-time chat functionality

This commit is contained in:
2026-05-14 10:09:23 +02:00
parent ddb37e057d
commit 8f0dc7f38c
3 changed files with 61 additions and 21 deletions

View File

@@ -18,7 +18,10 @@ export async function POST(request: NextRequest) {
}
try {
const { name, email, password } = await request.json();
const rawBody = await request.json();
const name = rawBody.name;
const email = rawBody.email?.toLowerCase().trim();
const password = rawBody.password;
// Basic validation
if (!name || !email || !password) {
@@ -47,8 +50,8 @@ export async function POST(request: NextRequest) {
);
}
// Hash password
const hashedPassword = await bcrypt.hash(password, 12);
// Hash password with 10 rounds to match seed and system verification standards
const hashedPassword = await bcrypt.hash(password, 10);
// Generate verification token
const verificationToken = crypto.randomBytes(32).toString('hex');
@@ -61,7 +64,7 @@ export async function POST(request: NextRequest) {
password: hashedPassword,
role: 'VISITOR', // Default role
verificationToken,
emailVerified: false,
emailVerified: process.env.NODE_ENV !== 'production', // Auto-vérifié en développement
}
});