import { triggerGAEvent } from "../helpers/event.helpers" export const janrainHandleLogout = (redirect) => { window.janrain && window.janrain.capture && window.janrain.capture.ui.endCaptureSession() const userId = window?.localStorage?.janrainCaptureProfileData && JSON.parse(window.localStorage.janrainCaptureProfileData) && JSON.parse(window.localStorage.janrainCaptureProfileData)?.uuid if (window.dataLayer !== undefined && !userId) { triggerGAEvent('event_profile_logout') } window.location = redirect ? redirect : '/' }