Skip to content

Commit 04c3878

Browse files
committed
fix: fix createDefaultAdmin bug and add debug lines for CI
1 parent e259081 commit 04c3878

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/service/passport/local.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ const configure = async (passport) => {
1313
return done(null, false, { message: "Incorrect username." });
1414
}
1515

16+
console.log(`Before bcrypt compare: user.password: ${user.password}`);
17+
console.log(`Before bcrypt compare: password: ${password}`);
1618
const passwordCorrect = await bcrypt.compare(password, user.password);
1719
if (!passwordCorrect) {
1820
return done(null, false, { message: "Incorrect password." });
@@ -47,7 +49,8 @@ const configure = async (passport) => {
4749
const createDefaultAdmin = async () => {
4850
const admin = await db.findUser("admin");
4951
if (!admin) {
50-
await db.createUser("admin", "admin", "[email protected]", "none", true, true, true, true);
52+
console.log("No admin user found. Creating default admin user...");
53+
await db.createUser("admin", "admin", "[email protected]", "none", true);
5154
}
5255
};
5356

0 commit comments

Comments
 (0)