Make /profile be the default location

This commit is contained in:
Seth Call 2025-03-04 07:36:39 -06:00
parent 383d9deeb3
commit 198adfe395
3 changed files with 8 additions and 4 deletions

View File

@ -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");
}

View File

@ -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));

View File

@ -28,7 +28,7 @@ const AuthCardLayout = ({ leftSideContent, children }) => {
<div className="z-index-1 position-relative">
<Link
className="text-white mb-4 text-sans-serif font-weight-extra-bold fs-4 d-inline-block"
to="/"
to="/profile"
>
falcon
</Link>