twenty/packages/twenty-e2e-testing/tests
Félix Malfait 6351c6c1c6
feat: remember original URL and redirect after login (#18308)
## Summary

- Implement a return-to-path mechanism that preserves the user's
intended destination across authentication flows (login, magic link,
cross-domain redirects)
- Uses layered persistence: Jotai atom (in-memory), sessionStorage with
TTL (tab-switch resilience), URL query parameter (cross-domain
propagation)
- Includes path validation to prevent open redirects, automatic cleanup
after successful login, and comprehensive test coverage
- Replaces the unused `previousUrlState` with a robust
`returnToPathState` system

## Test plan

- [ ] Visit a deep link (e.g. `/objects/tasks`) while logged out —
should redirect to login, then back to `/objects/tasks` after logging in
- [ ] Visit an OAuth authorize link while logged out — should redirect
to login, then to the authorize page
- [ ] Test magic link flow: click sign-in link that opens new tab —
should still redirect to original destination
- [ ] Test cross-domain: visit `app.twenty.com/objects/tasks` — should
preserve path through workspace domain redirect
- [ ] Verify auth/onboarding paths are excluded from being saved as
return paths
- [ ] Verify return-to-path is cleared after successful navigation
- [ ] All 215 existing `usePageChangeEffectNavigateLocation` tests pass


Made with [Cursor](https://cursor.com)
2026-03-02 19:00:48 +01:00
..
authentication feat: remember original URL and redirect after login (#18308) 2026-03-02 19:00:48 +01:00
create-kanban-view.spec.ts Fix E2E tests broken by redesigned navigation menu (#18315) 2026-03-02 10:52:10 +01:00
create-record.spec.ts Fix E2E tests broken by redesigned navigation menu (#18315) 2026-03-02 10:52:10 +01:00
login.setup.ts fix: e2e login test - handle optional Continue with Email button (#17146) 2026-01-14 11:57:15 +00:00
workflow-creation.spec.ts Feat: Navbar customization (#17728) 2026-02-11 15:33:51 +00:00
workflow-run.spec.ts e2e tests (#16533) 2025-12-17 08:48:17 +01:00
workflow-use-as-draft.spec.ts e2e tests (#16533) 2025-12-17 08:48:17 +01:00
workflow-visualizer.spec.ts e2e tests (#16533) 2025-12-17 08:48:17 +01:00