mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-11 06:29:04 +00:00
Add TRUST_SAML_EMAILS and TRUST_LDAP_EMAILS opts
This commit is contained in:
@@ -437,7 +437,7 @@ export const ldapConfigServiceFactory = ({
|
||||
{
|
||||
username: uniqueUsername,
|
||||
email: emails[0],
|
||||
isEmailVerified: false,
|
||||
isEmailVerified: appCfg.TRUST_LDAP_EMAILS,
|
||||
firstName,
|
||||
lastName,
|
||||
authMethods: [],
|
||||
@@ -557,7 +557,7 @@ export const ldapConfigServiceFactory = ({
|
||||
authTokenType: AuthTokenType.PROVIDER_TOKEN,
|
||||
userId: user.id,
|
||||
username: user.username,
|
||||
...(user.email && { email: user.email }),
|
||||
...(user.email && { email: user.email, isEmailVerified: user.isEmailVerified }),
|
||||
firstName,
|
||||
lastName,
|
||||
organizationName: organization.name,
|
||||
|
||||
@@ -374,7 +374,7 @@ export const samlConfigServiceFactory = ({
|
||||
{
|
||||
username: uniqueUsername,
|
||||
email,
|
||||
isEmailVerified: false,
|
||||
isEmailVerified: appCfg.TRUST_SAML_EMAILS,
|
||||
firstName,
|
||||
lastName,
|
||||
authMethods: [],
|
||||
@@ -414,7 +414,7 @@ export const samlConfigServiceFactory = ({
|
||||
authTokenType: AuthTokenType.PROVIDER_TOKEN,
|
||||
userId: user.id,
|
||||
username: user.username,
|
||||
...(user.email && { email: user.email }),
|
||||
...(user.email && { email: user.email, isEmailVerified: user.isEmailVerified }),
|
||||
firstName,
|
||||
lastName,
|
||||
organizationName: organization.name,
|
||||
|
||||
@@ -98,6 +98,9 @@ const envSchema = z
|
||||
CLIENT_ID_GITLAB: zpStr(z.string().optional()),
|
||||
CLIENT_SECRET_GITLAB: zpStr(z.string().optional()),
|
||||
URL_GITLAB_URL: zpStr(z.string().optional().default(GITLAB_URL)),
|
||||
// email verification
|
||||
TRUST_SAML_EMAILS: zodStrBool.default("false"),
|
||||
TRUST_LDAP_EMAILS: zodStrBool.default("false"),
|
||||
// SECRET-SCANNING
|
||||
SECRET_SCANNING_WEBHOOK_PROXY: zpStr(z.string().optional()),
|
||||
SECRET_SCANNING_WEBHOOK_SECRET: zpStr(z.string().optional()),
|
||||
|
||||
@@ -361,6 +361,7 @@ export const authLoginServiceFactory = ({
|
||||
user = await userDAL.create({
|
||||
username: email,
|
||||
email,
|
||||
isEmailVerified: true,
|
||||
firstName,
|
||||
lastName,
|
||||
authMethods: [authMethod],
|
||||
@@ -374,6 +375,8 @@ export const authLoginServiceFactory = ({
|
||||
authTokenType: AuthTokenType.PROVIDER_TOKEN,
|
||||
userId: user.id,
|
||||
username: user.username,
|
||||
email: user.email,
|
||||
isEmailVerified: user.isEmailVerified,
|
||||
firstName: user.firstName,
|
||||
lastName: user.lastName,
|
||||
authMethod,
|
||||
|
||||
@@ -135,11 +135,6 @@ export const authSignupServiceFactory = ({
|
||||
userAgent,
|
||||
authorization
|
||||
}: TCompleteAccountSignupDTO) => {
|
||||
console.log("completeEmailAccountSignup args: ", {
|
||||
email,
|
||||
firstName,
|
||||
lastName
|
||||
});
|
||||
const user = await userDAL.findOne({ username: email });
|
||||
if (!user || (user && user.isAccepted)) {
|
||||
throw new Error("Failed to complete account for complete user");
|
||||
|
||||
Reference in New Issue
Block a user