mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 22:26:41 +00:00
Add cloud check on github add user to default org
This commit is contained in:
@@ -347,7 +347,7 @@ export const registerSsoRouter = async (server: FastifyZodProvider) => {
|
|||||||
const serverCfg = await getServerCfg();
|
const serverCfg = await getServerCfg();
|
||||||
return res.redirect(
|
return res.redirect(
|
||||||
`${appCfg.SITE_URL}/signup/sso?token=${encodeURIComponent(req.passportUser.providerAuthToken)}${
|
`${appCfg.SITE_URL}/signup/sso?token=${encodeURIComponent(req.passportUser.providerAuthToken)}${
|
||||||
serverCfg.defaultAuthOrgId ? `&defaultOrgAllowed=true` : ""
|
serverCfg.defaultAuthOrgId && !appCfg.isCloud ? `&defaultOrgAllowed=true` : ""
|
||||||
}`
|
}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -724,7 +724,7 @@ export const authLoginServiceFactory = ({
|
|||||||
isGhost: false
|
isGhost: false
|
||||||
});
|
});
|
||||||
|
|
||||||
if (authMethod === AuthMethod.GITHUB && serverCfg.defaultAuthOrgId) {
|
if (authMethod === AuthMethod.GITHUB && serverCfg.defaultAuthOrgId && !appCfg.isCloud) {
|
||||||
let orgId = "";
|
let orgId = "";
|
||||||
const defaultOrg = await orgDAL.findOrgById(serverCfg.defaultAuthOrgId);
|
const defaultOrg = await orgDAL.findOrgById(serverCfg.defaultAuthOrgId);
|
||||||
if (!defaultOrg) {
|
if (!defaultOrg) {
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ export const authSignupServiceFactory = ({
|
|||||||
|
|
||||||
if (!organizationId) {
|
if (!organizationId) {
|
||||||
let orgId = "";
|
let orgId = "";
|
||||||
if (useDefaultOrg && serverCfg.defaultAuthOrgId) {
|
if (useDefaultOrg && serverCfg.defaultAuthOrgId && !appCfg.isCloud) {
|
||||||
const defaultOrg = await orgDAL.findOrgById(serverCfg.defaultAuthOrgId);
|
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" });
|
||||||
orgId = defaultOrg.id;
|
orgId = defaultOrg.id;
|
||||||
|
|||||||
Reference in New Issue
Block a user