logs
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
AUTH_SECRET=pY1fHh5vQ7cW6sZ3kE9jL2mN5rX8uB1g
|
|
||||||
|
AUTH_SECRET=7f8a7e6d5c4b3a291f0e9d8c7b6a5f4e3d2c1b0a9e8f7d6c5b4a39281f0e9d8c
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user