diff --git a/jam-ui/src/components/auth/LoginForm.js b/jam-ui/src/components/auth/LoginForm.js index 2c656ddc7..af4a30bbe 100644 --- a/jam-ui/src/components/auth/LoginForm.js +++ b/jam-ui/src/components/auth/LoginForm.js @@ -22,7 +22,11 @@ const LoginForm = ({ setRedirect, hasLabel, layout }) => { const { t } = useTranslation('auth'); const location = useLocation(); - let { from } = location.state || { from: { pathname: "/" } }; + + // We want to redirect to /profile after logging in , because we need to reserve `/` to be our 'mrketing site' + // So if somehow location.state says "/" , then we want to redirect to /profile + const defaultLocation = { pathname: "/profile" }; + let { from } = location.state || { from: defaultLocation }; const { login, setCurrentUser } = useAuth(); @@ -39,7 +43,8 @@ const LoginForm = ({ setRedirect, hasLabel, layout }) => { setEmail('') setPassword('') //setRedirect(true) - history.replace(from); + const finalDestination = from.pathname == "/" ? defaultLocation : from + history.replace(finalDestination); }else{ toast.error("Incorrect email or password"); } diff --git a/jam-ui/src/helpers/rest.js b/jam-ui/src/helpers/rest.js index f2f26079c..d00d24584 100644 --- a/jam-ui/src/helpers/rest.js +++ b/jam-ui/src/helpers/rest.js @@ -232,7 +232,6 @@ export const getLatencyToUsers = (currentUserId, participantIds) => { export const getLobbyChatMessages = (options = {}) => { return new Promise((resolve, reject) => { - console.log('getLobbyChatMessages', options); apiFetch(`/chat?${new URLSearchParams(options)}`) .then(response => resolve(response)) .catch(error => reject(error)); diff --git a/jam-ui/src/layouts/AuthCardLayout.js b/jam-ui/src/layouts/AuthCardLayout.js index c126a2440..304de736e 100644 --- a/jam-ui/src/layouts/AuthCardLayout.js +++ b/jam-ui/src/layouts/AuthCardLayout.js @@ -28,7 +28,7 @@ const AuthCardLayout = ({ leftSideContent, children }) => {
falcon