mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
refactor(editor): Add telemetry for SSO/SAML (no-changelog) (#8102)
https://linear.app/n8n/issue/PAY-1142
This commit is contained in:
parent
1d1cb0d3c5
commit
faadfd6d4a
|
@ -6,6 +6,8 @@ import CopyInput from '@/components/CopyInput.vue';
|
||||||
import { useI18n } from '@/composables/useI18n';
|
import { useI18n } from '@/composables/useI18n';
|
||||||
import { useMessage } from '@/composables/useMessage';
|
import { useMessage } from '@/composables/useMessage';
|
||||||
import { useToast } from '@/composables/useToast';
|
import { useToast } from '@/composables/useToast';
|
||||||
|
import { useTelemetry } from '@/composables/useTelemetry';
|
||||||
|
import { useRootStore } from '@/stores/n8nRoot.store';
|
||||||
|
|
||||||
const IdentityProviderSettingsType = {
|
const IdentityProviderSettingsType = {
|
||||||
URL: 'url',
|
URL: 'url',
|
||||||
|
@ -13,6 +15,8 @@ const IdentityProviderSettingsType = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const i18n = useI18n();
|
const i18n = useI18n();
|
||||||
|
const telemetry = useTelemetry();
|
||||||
|
const rootStore = useRootStore();
|
||||||
const ssoStore = useSSOStore();
|
const ssoStore = useSSOStore();
|
||||||
const uiStore = useUIStore();
|
const uiStore = useUIStore();
|
||||||
const message = useMessage();
|
const message = useMessage();
|
||||||
|
@ -78,6 +82,8 @@ const getSamlConfig = async () => {
|
||||||
ssoSettingsSaved.value = !!config?.metadata;
|
ssoSettingsSaved.value = !!config?.metadata;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let testSucceeded = false;
|
||||||
|
|
||||||
const onSave = async () => {
|
const onSave = async () => {
|
||||||
try {
|
try {
|
||||||
const config =
|
const config =
|
||||||
|
@ -100,6 +106,13 @@ const onSave = async () => {
|
||||||
await onTest();
|
await onTest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
telemetry.track('User updated single sign on settings', {
|
||||||
|
instance_id: rootStore.instanceId,
|
||||||
|
identity_provider: ipsType.value === 'url' ? 'metadata' : 'xml',
|
||||||
|
is_valid: testSucceeded,
|
||||||
|
is_active: ssoStore.isSamlLoginEnabled,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toast.showError(error, i18n.baseText('settings.sso.settings.save.error'));
|
toast.showError(error, i18n.baseText('settings.sso.settings.save.error'));
|
||||||
return;
|
return;
|
||||||
|
@ -115,8 +128,10 @@ const onTest = async () => {
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
window.open(url, '_blank');
|
window.open(url, '_blank');
|
||||||
}
|
}
|
||||||
|
testSucceeded = true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toast.showError(error, 'error');
|
toast.showError(error, 'error');
|
||||||
|
testSucceeded = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue