Skip to content

fix: redirect authenticated users from login page to chat#289

Open
divyasharma1321 wants to merge 1 commit into
chthonn:mainfrom
divyasharma1321:main
Open

fix: redirect authenticated users from login page to chat#289
divyasharma1321 wants to merge 1 commit into
chthonn:mainfrom
divyasharma1321:main

Conversation

@divyasharma1321

Copy link
Copy Markdown

A Discord-style real-time chat app with DMs, servers/channels, presence, and email OTP auth.

@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the Sunil Kumar's projects Team on Vercel.

A member of the Team first needs to authorize it.

@chthonn

chthonn commented Jul 3, 2026

Copy link
Copy Markdown
Owner

@divyasharma1321 can you please revert package.lock.json

@divyasharma1321

Copy link
Copy Markdown
Author

I've reverted package-lock.json. Please review again. Thank you!

@chthonn

chthonn commented Jul 5, 2026

Copy link
Copy Markdown
Owner

@divyasharma1321 still there.

@divyasharma1321

Copy link
Copy Markdown
Author

Hi, I'm still here! Thank you for the follow-up.

Here is a summary of what I've done to fix the issue:

  1. The Problem: Authenticated users were still seeing the login page.
  2. The Fix: I added a session check in Login.jsx that runs when the page loads:
    const navigate = useNavigate();
    useEffect(() => {
      const token = localStorage.getItem('token');
      if (token) {
        navigate('/channels/@me', { replace: true });
      }
    }, [navigate]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants