mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-17 12:19:50 +02:00
feat: Implement NextAuth for credentials-based authentication and add initial admin user seeding logic.
This commit is contained in:
1 parent
cfd079fbf5
commit
a03fd64b5d
2 files changed
+25
-7
No files matched your search
@@ -26,9 +26,13 @@ export const { handlers, auth, signIn, signOut } = NextAuth({
|
||||
.from(users)
|
||||
.where(eq(users.username, credentials.username as string));
|
||||
|
||||
console.log(`BMAD: Auth attempt for "${credentials.username}". User found: ${!!user}`);
|
||||
|
||||
if (!user) return null;
|
||||
|
||||
const isValid = verifyPassword(credentials.password as string, user.passwordHash);
|
||||
console.log(`BMAD: Password valid for "${credentials.username}": ${isValid}`);
|
||||
|
||||
if (!isValid) return null;
|
||||
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user