mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -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 { useMessage } from '@/composables/useMessage';
|
||||
import { useToast } from '@/composables/useToast';
|
||||
import { useTelemetry } from '@/composables/useTelemetry';
|
||||
import { useRootStore } from '@/stores/n8nRoot.store';
|
||||
|
||||
const IdentityProviderSettingsType = {
|
||||
URL: 'url',
|
||||
|
@ -13,6 +15,8 @@ const IdentityProviderSettingsType = {
|
|||
};
|
||||
|
||||
const i18n = useI18n();
|
||||
const telemetry = useTelemetry();
|
||||
const rootStore = useRootStore();
|
||||
const ssoStore = useSSOStore();
|
||||
const uiStore = useUIStore();
|
||||
const message = useMessage();
|
||||
|
@ -78,6 +82,8 @@ const getSamlConfig = async () => {
|
|||
ssoSettingsSaved.value = !!config?.metadata;
|
||||
};
|
||||
|
||||
let testSucceeded = false;
|
||||
|
||||
const onSave = async () => {
|
||||
try {
|
||||
const config =
|
||||
|
@ -100,6 +106,13 @@ const onSave = async () => {
|
|||
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) {
|
||||
toast.showError(error, i18n.baseText('settings.sso.settings.save.error'));
|
||||
return;
|
||||
|
@ -115,8 +128,10 @@ const onTest = async () => {
|
|||
if (typeof window !== 'undefined') {
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
testSucceeded = true;
|
||||
} catch (error) {
|
||||
toast.showError(error, 'error');
|
||||
testSucceeded = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue