feat: Implement NextAuth for credentials-based authentication and add initial admin user seeding logic.

This commit is contained in:
Michael committed 2026-02-22 14:20:31 +01:00
1 parent cfd079fbf5
commit a03fd64b5d
2 files changed
+25 -7

No files matched your search

+4
View File
@@ -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 {