This commit is contained in:
Leon Serfaty G
2025-07-17 11:55:14 +00:00
parent 9aebf5b604
commit a013967f95
2 changed files with 2 additions and 5 deletions
+2 -1
View File
@@ -1 +1,2 @@
AUTH_SECRET=pY1fHh5vQ7cW6sZ3kE9jL2mN5rX8uB1g
AUTH_SECRET=7f8a7e6d5c4b3a291f0e9d8c7b6a5f4e3d2c1b0a9e8f7d6c5b4a39281f0e9d8c
-4
View File
@@ -14,7 +14,6 @@ export const {
providers: [ providers: [
CredentialsProvider({ CredentialsProvider({
name: 'Credentials', name: 'Credentials',
// The 'type' property is required for the Credentials provider.
type: 'credentials', type: 'credentials',
credentials: { credentials: {
email: { label: 'Email', type: 'email' }, email: { label: 'Email', type: 'email' },
@@ -32,16 +31,13 @@ export const {
const stmt = db.prepare('SELECT * FROM users WHERE email = ?'); const stmt = db.prepare('SELECT * FROM users WHERE email = ?');
const user = stmt.get(email) as User | undefined; const user = stmt.get(email) as User | undefined;
// In a real app, you would use a secure password hashing library like bcrypt
if (user && user.password === password) { if (user && user.password === password) {
// Return a user object that NextAuth will use to create the session
return { return {
id: user.id.toString(), id: user.id.toString(),
name: user.name, name: user.name,
email: user.email, email: user.email,
}; };
} else { } else {
// Invalid credentials
return null; return null;
} }
} catch (error) { } catch (error) {