Rewrite /invite/[token] so invited users can create an account and join a workspace in a single page instead of bouncing to /signup. The page branches on verify response + session state: - New user: inline signup form (name + password, email locked), then auto signs in and redirects to the dashboard. - Existing user, signed out: password-only login form that signs in and auto-calls /api/invitations/accept. - Existing user, signed in with matching email: single Accept button. - Existing user, signed in with mismatched email: amber notice plus one-click "Sign out and continue" that returns to the same invite URL logged out. Also: - Expired / already-accepted / not-found states now show the inviter's name and org context so users know who to contact for a new link. - Extract the password + confirm-password + strength meter into a reusable <PasswordFields> component consumed by both the signup and invite pages so the UI stays in lockstep. The component supports hiding the confirm field and overriding autoComplete for login use. Made-with: Cursor |
||
|---|---|---|
| .. | ||
| app | ||
| components | ||
| lib | ||
| types | ||
| auth.ts | ||
| instrumentation.ts | ||
| middleware.ts | ||