[PR #1309] [MERGED] fix: make invite and confirmations long lived #1546

Closed
opened 2026-02-26 19:33:43 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1309
Author: @Mythie
Created: 8/28/2024
Status: Merged
Merged: 8/28/2024
Merged by: @Mythie

Base: mainHead: fix/make-invites-and-confirmations-long-lived


📝 Commits (3)

  • 33561fa fix: make invite and confirmations long lived
  • 1d4a755 fix: build error
  • 3bfccf9 fix: update test

📊 Changes

18 files changed (+354 additions, -99 deletions)

View changed files

📝 apps/web/src/app/(unauthenticated)/team/verify/email/[token]/page.tsx (+35 -0)
📝 apps/web/src/app/(unauthenticated)/team/verify/transfer/[token]/page.tsx (+23 -0)
apps/web/src/app/(unauthenticated)/verify-email/[token]/client.tsx (+56 -0)
📝 apps/web/src/app/(unauthenticated)/verify-email/[token]/page.tsx (+38 -39)
📝 packages/app-tests/e2e/user/auth-flow.spec.ts (+2 -1)
📝 packages/lib/next-auth/auth-options.ts (+50 -0)
📝 packages/lib/server-only/team/accept-team-invitation.ts (+12 -1)
📝 packages/lib/server-only/team/transfer-team-ownership.ts (+18 -5)
📝 packages/lib/server-only/user/verify-email.ts (+28 -5)
📝 packages/lib/translations/de/common.po (+0 -1)
📝 packages/lib/translations/de/marketing.js (+1 -1)
📝 packages/lib/translations/de/marketing.po (+0 -1)
📝 packages/lib/translations/de/web.js (+1 -1)
📝 packages/lib/translations/de/web.po (+39 -22)
📝 packages/lib/translations/en/web.js (+1 -1)
📝 packages/lib/translations/en/web.po (+39 -21)
packages/prisma/migrations/20240828014236_add_completed_flag_for_verification_tokens/migration.sql (+8 -0)
📝 packages/prisma/schema.prisma (+3 -0)

📄 Description

Description

Previously we would delete all invites and confirmation tokens upon completing the action that they represent.

This change instead adds a flag on each token indicating whether it has been completed so we can action a
completed token differently in the UI to reduce confusion for users.

This had been brought up a number of times where confirmation emails, team member invites and other items
may have been actioned and forgotten about causing an error toast/page upon subsequent revisit.

N/A

Changes Made

  • Added the completed boolean to the appropriate models
  • Added UI handling for pages to gracefully handle already completed tokens
  • Added automatic sign-in for email confirmation tokens

Testing Performed

  • Confirmed an email
  • Invited a team member
  • Added a team email

Summary by CodeRabbit

  • New Features

    • Introduced user feedback for email verification and team transfer processes, displaying messages for already completed actions.
    • Added a new component for handling email verification and user authentication, enhancing user experience.
    • Implemented a more robust email verification state management system to track various verification statuses.
    • Streamlined user flow by automatically redirecting users after email confirmation.
  • Bug Fixes

    • Improved handling of expired verification tokens and invitations to ensure accurate user experience.
  • Documentation

    • Updated localization strings for improved clarity and accuracy in user-facing messages.
  • Chores

    • Enhanced database schema to track the completion status of verification processes for better data management.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/1309 **Author:** [@Mythie](https://github.com/Mythie) **Created:** 8/28/2024 **Status:** ✅ Merged **Merged:** 8/28/2024 **Merged by:** [@Mythie](https://github.com/Mythie) **Base:** `main` ← **Head:** `fix/make-invites-and-confirmations-long-lived` --- ### 📝 Commits (3) - [`33561fa`](https://github.com/documenso/documenso/commit/33561faff769e0adb39b0437333d658899c81d7e) fix: make invite and confirmations long lived - [`1d4a755`](https://github.com/documenso/documenso/commit/1d4a755cecdba18a20779cebabe1730c250faa8d) fix: build error - [`3bfccf9`](https://github.com/documenso/documenso/commit/3bfccf960e0d617a6ec3863bc83410e5b23c1628) fix: update test ### 📊 Changes **18 files changed** (+354 additions, -99 deletions) <details> <summary>View changed files</summary> 📝 `apps/web/src/app/(unauthenticated)/team/verify/email/[token]/page.tsx` (+35 -0) 📝 `apps/web/src/app/(unauthenticated)/team/verify/transfer/[token]/page.tsx` (+23 -0) ➕ `apps/web/src/app/(unauthenticated)/verify-email/[token]/client.tsx` (+56 -0) 📝 `apps/web/src/app/(unauthenticated)/verify-email/[token]/page.tsx` (+38 -39) 📝 `packages/app-tests/e2e/user/auth-flow.spec.ts` (+2 -1) 📝 `packages/lib/next-auth/auth-options.ts` (+50 -0) 📝 `packages/lib/server-only/team/accept-team-invitation.ts` (+12 -1) 📝 `packages/lib/server-only/team/transfer-team-ownership.ts` (+18 -5) 📝 `packages/lib/server-only/user/verify-email.ts` (+28 -5) 📝 `packages/lib/translations/de/common.po` (+0 -1) 📝 `packages/lib/translations/de/marketing.js` (+1 -1) 📝 `packages/lib/translations/de/marketing.po` (+0 -1) 📝 `packages/lib/translations/de/web.js` (+1 -1) 📝 `packages/lib/translations/de/web.po` (+39 -22) 📝 `packages/lib/translations/en/web.js` (+1 -1) 📝 `packages/lib/translations/en/web.po` (+39 -21) ➕ `packages/prisma/migrations/20240828014236_add_completed_flag_for_verification_tokens/migration.sql` (+8 -0) 📝 `packages/prisma/schema.prisma` (+3 -0) </details> ### 📄 Description ## Description Previously we would delete all invites and confirmation tokens upon completing the action that they represent. This change instead adds a flag on each token indicating whether it has been completed so we can action a completed token differently in the UI to reduce confusion for users. This had been brought up a number of times where confirmation emails, team member invites and other items may have been actioned and forgotten about causing an error toast/page upon subsequent revisit. ## Related Issue N/A ## Changes Made - Added the completed boolean to the appropriate models - Added UI handling for pages to gracefully handle already completed tokens - Added automatic sign-in for email confirmation tokens ## Testing Performed - Confirmed an email - Invited a team member - Added a team email <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced user feedback for email verification and team transfer processes, displaying messages for already completed actions. - Added a new component for handling email verification and user authentication, enhancing user experience. - Implemented a more robust email verification state management system to track various verification statuses. - Streamlined user flow by automatically redirecting users after email confirmation. - **Bug Fixes** - Improved handling of expired verification tokens and invitations to ensure accurate user experience. - **Documentation** - Updated localization strings for improved clarity and accuracy in user-facing messages. - **Chores** - Enhanced database schema to track the completion status of verification processes for better data management. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:33:43 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1546
No description provided.