open-saas icon indicating copy to clipboard operation
open-saas copied to clipboard

Redirect logged-in users from /login and /signup to /demo-app

Open Copilot opened this issue 3 months ago • 0 comments

Description

Logged-in users accessing /login or /signup are now redirected to /demo-app using useNavigate from react-router-dom.

Changes:

  • LoginPage.tsx & SignupPage.tsx: Added useEffect hook that checks auth status via useAuth() and redirects when user is present
  • authRedirectTests.spec.ts: E2e tests verifying redirect behavior for both routes
const { data: user } = useAuth();
const navigate = useNavigate();

useEffect(() => {
  if (user) {
    navigate("/demo-app");
  }
}, [user, navigate]);

Contributor Checklist

  • [x] Update e2e tests: If you changed the /template/app, then make sure to do any neccessary updates to /template/e2e-tests also.
  • [ ] Update demo app: If you changed the /template/app, then make sure to do any neccessary updates to /opensaas-sh/app_diff also. Check /opensaas-sh/README.md for details.
  • [ ] Update docs: If needed, update the /opensaas-sh/blog/src/content/docs.
Original prompt

This section details on the original issue you should resolve

<issue_title>redirect from /login and /signup to /demo-app if logged in</issue_title> <issue_description>use useNavigate from react-router-dom</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes wasp-lang/open-saas#475

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot avatar Nov 14 '25 14:11 Copilot