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
-4
View File
@@ -14,7 +14,6 @@ export const {
providers: [
CredentialsProvider({
name: 'Credentials',
// The 'type' property is required for the Credentials provider.
type: 'credentials',
credentials: {
email: { label: 'Email', type: 'email' },
@@ -32,16 +31,13 @@ export const {
const stmt = db.prepare('SELECT * FROM users WHERE email = ?');
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) {
// Return a user object that NextAuth will use to create the session
return {
id: user.id.toString(),
name: user.name,
email: user.email,
};
} else {
// Invalid credentials
return null;
}
} catch (error) {