diff --git a/packages/ui-react/src/containers/AccountModal/forms/Registration.tsx b/packages/ui-react/src/containers/AccountModal/forms/Registration.tsx index a79cbe5b5..c7443a1c5 100644 --- a/packages/ui-react/src/containers/AccountModal/forms/Registration.tsx +++ b/packages/ui-react/src/containers/AccountModal/forms/Registration.tsx @@ -8,7 +8,7 @@ import AccountController from '@jwp/ott-common/src/controllers/AccountController import { checkConsentsFromValues, extractConsentValues, formatConsentsFromValues } from '@jwp/ott-common/src/utils/collection'; import useSocialLoginUrls from '@jwp/ott-hooks-react/src/useSocialLoginUrls'; import useForm from '@jwp/ott-hooks-react/src/useForm'; -import { modalURLFromLocation } from '@jwp/ott-ui-react/src/utils/location'; +import { modalURLFromLocation, modalURLFromWindowLocation } from '@jwp/ott-ui-react/src/utils/location'; import { useAccountStore } from '@jwp/ott-common/src/stores/AccountStore'; import RegistrationForm from '../../../components/RegistrationForm/RegistrationForm'; @@ -55,7 +55,7 @@ const Registration = () => { setConsentValues(extractConsentValues(publisherConsents)); }, [accountController, publisherConsents]); - const socialLoginURLs = useSocialLoginUrls(window.location.href.split('?')[0]); + const socialLoginURLs = useSocialLoginUrls(modalURLFromWindowLocation('personal-details')); const { handleSubmit, handleChange, handleBlur, values, errors, validationSchemaError, submitting } = useForm({ initialValues: { email: '', password: '' }, diff --git a/platforms/web/src/containers/AppRoutes/AppRoutes.tsx b/platforms/web/src/containers/AppRoutes/AppRoutes.tsx index c8c851617..8291728d9 100644 --- a/platforms/web/src/containers/AppRoutes/AppRoutes.tsx +++ b/platforms/web/src/containers/AppRoutes/AppRoutes.tsx @@ -32,6 +32,7 @@ import { PATH_USER_PROFILES_EDIT_PROFILE, PATH_SEARCH, PATH_USER, + PATH_HOME, } from '@jwp/ott-common/src/paths'; import useNotifications from '#src/hooks/useNotifications'; @@ -53,7 +54,7 @@ export default function AppRoutes() { useNotifications(); if (userData.user && !userData.loading && window.location.href.includes('#token')) { - return ; // component instead of hook to prevent extra re-renders + return ; // component instead of hook to prevent extra re-renders } if (userData.user && selectingProfileAvatar !== null) {