@ -1,4 +1,5 @@
|
|||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
|
import { v4 } from 'uuid';
|
||||||
import { useTrackMutation } from '~/generated/graphql';
|
import { useTrackMutation } from '~/generated/graphql';
|
||||||
export interface EventData {
|
export interface EventData {
|
||||||
pathname: string;
|
pathname: string;
|
||||||
@ -19,7 +20,7 @@ export const getSessionId = (): string => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const setSessionId = (domain?: string): void => {
|
export const setSessionId = (domain?: string): void => {
|
||||||
const sessionId = getSessionId() || crypto.randomUUID();
|
const sessionId = getSessionId() || v4();
|
||||||
const baseCookie = `${ANALYTICS_COOKIE_NAME}=${sessionId}; Max-Age=1800; path=/; secure`;
|
const baseCookie = `${ANALYTICS_COOKIE_NAME}=${sessionId}; Max-Age=1800; path=/; secure`;
|
||||||
const cookie = domain ? baseCookie + `; domain=${domain}` : baseCookie;
|
const cookie = domain ? baseCookie + `; domain=${domain}` : baseCookie;
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
/* @license Enterprise */
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { SettingSecurityNewSSOIdentityFormValues } from '@/settings/security/types/SSOIdentityProvider';
|
import { SettingSecurityNewSSOIdentityFormValues } from '@/settings/security/types/SSOIdentityProvider';
|
||||||
|
import { v4 } from 'uuid';
|
||||||
import { IdentityProviderType } from '~/generated/graphql';
|
import { IdentityProviderType } from '~/generated/graphql';
|
||||||
|
|
||||||
export const sSOIdentityProviderDefaultValues: Record<
|
export const sSOIdentityProviderDefaultValues: Record<
|
||||||
@ -11,15 +12,7 @@ export const sSOIdentityProviderDefaultValues: Record<
|
|||||||
type: 'SAML',
|
type: 'SAML',
|
||||||
ssoURL: '',
|
ssoURL: '',
|
||||||
name: '',
|
name: '',
|
||||||
id:
|
id: v4(),
|
||||||
window.location.protocol === 'https:'
|
|
||||||
? crypto.randomUUID()
|
|
||||||
: '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) =>
|
|
||||||
(
|
|
||||||
+c ^
|
|
||||||
(crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (+c / 4)))
|
|
||||||
).toString(16),
|
|
||||||
),
|
|
||||||
certificate: '',
|
certificate: '',
|
||||||
issuer: '',
|
issuer: '',
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user