mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
feat(editor): Add additional email domains to our disallowed list for self-serve enterprise license (no-changelog) (#8161)
This commit is contained in:
@@ -55,9 +55,6 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { mapStores } from 'pinia';
|
||||
|
||||
const SURVEY_VERSION = 'v4';
|
||||
|
||||
import {
|
||||
COMPANY_SIZE_100_499,
|
||||
COMPANY_SIZE_1000_OR_MORE,
|
||||
@@ -158,6 +155,8 @@ import { useExternalHooks } from '@/composables/useExternalHooks';
|
||||
import { useUsageStore } from '@/stores/usage.store';
|
||||
import { useMessage } from '@/composables/useMessage';
|
||||
|
||||
const SURVEY_VERSION = 'v4';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'PersonalizationModal',
|
||||
components: { Modal },
|
||||
@@ -188,6 +187,7 @@ export default defineComponent({
|
||||
registerForEnterpriseTrial: false,
|
||||
modalBus: createEventBus(),
|
||||
formBus: createEventBus(),
|
||||
domainBlocklist: [] as string[],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -203,7 +203,11 @@ export default defineComponent({
|
||||
return this.usersStore.currentUser;
|
||||
},
|
||||
canRegisterForEnterpriseTrial() {
|
||||
if (this.settingsStore.isCloudDeployment) {
|
||||
if (
|
||||
this.settingsStore.isCloudDeployment ||
|
||||
this.domainBlocklist.length === 0 ||
|
||||
!this.currentUser?.email
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -211,20 +215,11 @@ export default defineComponent({
|
||||
this.formValues[COMPANY_SIZE_KEY],
|
||||
);
|
||||
|
||||
const emailParts = (this.currentUser?.email || '@').split('@');
|
||||
const emailParts = this.currentUser.email.split('@');
|
||||
const emailDomain = emailParts[emailParts.length - 1];
|
||||
const emailDomainParts = emailDomain.split('.');
|
||||
const isEmailEligible = ![
|
||||
'gmail',
|
||||
'yahoo',
|
||||
'hotmail',
|
||||
'aol',
|
||||
'live',
|
||||
'outlook',
|
||||
'icloud',
|
||||
'mail',
|
||||
'email',
|
||||
].find((provider) => emailDomainParts.includes(provider));
|
||||
const isEmailEligible = !this.domainBlocklist.find(
|
||||
(blocklistedDomain) => emailDomain === blocklistedDomain,
|
||||
);
|
||||
|
||||
return isSizeEligible && isEmailEligible;
|
||||
},
|
||||
@@ -679,6 +674,9 @@ export default defineComponent({
|
||||
return survey;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
void this.loadDomainBlocklist();
|
||||
},
|
||||
methods: {
|
||||
closeDialog() {
|
||||
this.modalBus.emit('close');
|
||||
@@ -688,6 +686,11 @@ export default defineComponent({
|
||||
void this.$router.replace({ name: VIEWS.NEW_WORKFLOW });
|
||||
}
|
||||
},
|
||||
async loadDomainBlocklist() {
|
||||
try {
|
||||
this.domainBlocklist = (await import('email-providers/common.json')).default;
|
||||
} catch (error) {}
|
||||
},
|
||||
onSave() {
|
||||
this.formBus.emit('submit');
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user