mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Add minor improvements to Github SSO users added to default organization on signup
This commit is contained in:
@@ -50,8 +50,7 @@ export const SecretNameSchema = BaseSecretNameSchema.refine(
|
||||
.refine((el) => !el.includes("/"), "Secret name cannot contain forward slash.");
|
||||
|
||||
const DefaultOrgSchema = z.object({
|
||||
useDefaultOrg: z.literal(true),
|
||||
organizationName: z.string().trim().optional()
|
||||
useDefaultOrg: z.literal(true)
|
||||
});
|
||||
|
||||
const CustomOrgSchema = z.object({
|
||||
|
||||
@@ -727,7 +727,11 @@ export const authLoginServiceFactory = ({
|
||||
if (authMethod === AuthMethod.GITHUB && serverCfg.defaultAuthOrgId) {
|
||||
let orgId = "";
|
||||
const defaultOrg = await orgDAL.findOrgById(serverCfg.defaultAuthOrgId);
|
||||
if (!defaultOrg) throw new BadRequestError({ message: "Failed to find default organization" });
|
||||
if (!defaultOrg) {
|
||||
throw new BadRequestError({
|
||||
message: `Failed to find default organization with ID ${serverCfg.defaultAuthOrgId}`
|
||||
});
|
||||
}
|
||||
orgId = defaultOrg.id;
|
||||
const [orgMembership] = await orgDAL.findMembership({
|
||||
[`${TableName.OrgMembership}.userId` as "userId"]: user.id,
|
||||
|
||||
Reference in New Issue
Block a user