mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 09:30:09 +00:00
Minor LDAP patches, docs for JumpCloud LDAP
This commit is contained in:
@@ -17,8 +17,8 @@ export async function up(knex: Knex): Promise<void> {
|
||||
t.string("encryptedBindPass");
|
||||
t.string("bindPassIV");
|
||||
t.string("bindPassTag");
|
||||
t.text("searchBase").notNullable();
|
||||
t.string("encryptedCACert");
|
||||
t.string("searchBase").notNullable();
|
||||
t.text("encryptedCACert");
|
||||
t.string("caCertIV");
|
||||
t.string("caCertTag");
|
||||
t.timestamps(true, true, true);
|
||||
@@ -43,7 +43,7 @@ export async function down(knex: Knex): Promise<void> {
|
||||
await knex.schema.alterTable(TableName.Users, (t) => {
|
||||
t.dropColumn("username");
|
||||
t.dropColumn("orgId");
|
||||
t.string("email").notNullable().alter();
|
||||
// t.string("email").notNullable().alter();
|
||||
});
|
||||
await dropOnUpdateTrigger(knex, TableName.LdapConfig);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ export const registerLdapRouter = async (server: FastifyZodProvider) => {
|
||||
return cb(null, { isUserCompleted, providerAuthToken });
|
||||
} catch (err) {
|
||||
logger.error(err);
|
||||
return cb(null, false);
|
||||
return cb(err, false);
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -57,9 +57,9 @@ export const registerLdapRouter = async (server: FastifyZodProvider) => {
|
||||
})
|
||||
},
|
||||
preValidation: passport.authenticate("ldapauth", {
|
||||
session: false,
|
||||
failureFlash: true,
|
||||
failureRedirect: "/login/provider/error"
|
||||
session: false
|
||||
// failureFlash: true,
|
||||
// failureRedirect: "/login/provider/error"
|
||||
// this is due to zod type difference
|
||||
}) as any,
|
||||
handler: (req, res) => {
|
||||
|
||||
@@ -34,6 +34,12 @@ export const userServiceFactory = ({ userDAL }: TUserServiceFactoryDep) => {
|
||||
const user = await userDAL.findById(userId);
|
||||
if (!user) throw new BadRequestError({ name: "Update auth methods" });
|
||||
|
||||
if (user.authMethods?.includes(AuthMethod.LDAP))
|
||||
throw new BadRequestError({ message: "LDAP auth method cannot be updated", name: "Update auth methods" });
|
||||
|
||||
if (authMethods.includes(AuthMethod.LDAP))
|
||||
throw new BadRequestError({ message: "LDAP auth method cannot be updated", name: "Update auth methods" });
|
||||
|
||||
const updatedUser = await userDAL.updateById(userId, { authMethods });
|
||||
return updatedUser;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user