Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat: resolved hashedPassword not set for bootstrap admin

=009a5b67c6e0
diff --git a/backend/src/services/super-admin/super-admin-service.ts b/backend/src/services/super-admin/super-admin-service.ts
index e82af7b680..ffb8920b8e 100644
--- a/backend/src/services/super-admin/super-admin-service.ts
+++ b/backend/src/services/super-admin/super-admin-service.ts
@@ -565,6 +565,7 @@ export const superAdminServiceFactory = ({
if (existingUser) throw new BadRequestError({ name: "Instance initialization", message: "User already exists" });
const userInfo = await userDAL.transaction(async (tx) => {
+ const hashedPassword = await crypto.hashing().createHash(password, appCfg.SALT_ROUNDS);
const newUser = await userDAL.create(
{
firstName: "Admin",
@@ -575,13 +576,12 @@ export const superAdminServiceFactory = ({
isGhost: false,
isAccepted: true,
authMethods: [AuthMethod.EMAIL],
- isEmailVerified: true
+ isEmailVerified: true,
+ hashedPassword
},
tx
);
- const hashedPassword = await crypto.hashing().createHash(password, appCfg.SALT_ROUNDS);
-
const userEnc = await userDAL.createUserEncryption(
{
userId: newUser.id,
@@ -591,7 +591,7 @@ export const superAdminServiceFactory = ({
tx
);
- return { user: newUser, enc: userEnc };
+ return { user: { ...newUser, hashedPassword: null }, enc: userEnc };
});
const initialOrganizationName = organizationName ?? "Admin Org";