mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-11 12:29:26 +00:00
Add minor improvements to Github SSO users added to default organization on signup
This commit is contained in:
@@ -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