[PR #1547] [MERGED] feat: admin ui for disabling users #1707

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

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1547
Author: @catalinpit
Created: 12/17/2024
Status: Merged
Merged: 12/30/2024
Merged by: @Mythie

Base: mainHead: feat/admin-ui-to-disable-users


📝 Commits (10+)

  • 57a69d7 feat: admin ui for disabling users
  • c804fe4 feat: log user out when disabled
  • 8045b7e chore: move the disabled check from auth-options
  • f173726 chore: improve the disable user func
  • 08bfce8 chore: improve the disable user func
  • 879d39e Merge branch 'main' into feat/admin-ui-to-disable-users
  • 2729a50 chore: added back the code removed by mistake
  • 968a1e0 Merge branch 'main' into feat/admin-ui-to-disable-users
  • b6a55ea chore: add enable user functionality
  • 9a058cc Merge branch 'main' into feat/admin-ui-to-disable-users

📊 Changes

10 files changed (+451 additions, -13 deletions)

View changed files

📝 apps/web/src/app/(dashboard)/admin/users/[id]/delete-user-dialog.tsx (+2 -3)
apps/web/src/app/(dashboard)/admin/users/[id]/disable-user-dialog.tsx (+141 -0)
apps/web/src/app/(dashboard)/admin/users/[id]/enable-user-dialog.tsx (+130 -0)
📝 apps/web/src/app/(dashboard)/admin/users/[id]/page.tsx (+7 -1)
📝 packages/api/v1/middleware/authenticated.ts (+20 -4)
📝 packages/lib/next-auth/get-server-component-session.ts (+4 -0)
packages/lib/server-only/user/disable-user.ts (+69 -0)
packages/lib/server-only/user/enable-user.ts (+27 -0)
📝 packages/trpc/server/admin-router/router.ts (+39 -4)
📝 packages/trpc/server/admin-router/schema.ts (+12 -1)

📄 Description

My thoughts on how disabling should work.

When the user is disabled:

  • disable the following:

    • all API keys - set the expiration date to new Date() (the current date and time)
    • all webhooks - set the enabled field to false
    • verification tokens (if any) - set the expiration date to new Date() (the current date and time)
    • password reset tokens (if any) - set the expiration date to new Date() (the current date and time)
  • delete the following:

    • passkeys (if any)

What about subscriptions, though?

What should we do with the teams created by the disabled user?

Any other thoughts?


🔄 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/1547 **Author:** [@catalinpit](https://github.com/catalinpit) **Created:** 12/17/2024 **Status:** ✅ Merged **Merged:** 12/30/2024 **Merged by:** [@Mythie](https://github.com/Mythie) **Base:** `main` ← **Head:** `feat/admin-ui-to-disable-users` --- ### 📝 Commits (10+) - [`57a69d7`](https://github.com/documenso/documenso/commit/57a69d79125606a91c1877d8c2f5c1eb5169a7da) feat: admin ui for disabling users - [`c804fe4`](https://github.com/documenso/documenso/commit/c804fe49929e5226582e158bfe755b9a45781f86) feat: log user out when disabled - [`8045b7e`](https://github.com/documenso/documenso/commit/8045b7e24387744fadc5473fce3b0ab38bf1b86a) chore: move the disabled check from auth-options - [`f173726`](https://github.com/documenso/documenso/commit/f173726c1e5eea267734f50213dedd6462af23a1) chore: improve the disable user func - [`08bfce8`](https://github.com/documenso/documenso/commit/08bfce834efa647435cccdd7555a7b516c259b78) chore: improve the disable user func - [`879d39e`](https://github.com/documenso/documenso/commit/879d39e23c15fba7c5bd9a1ea85373ac523aec6d) Merge branch 'main' into feat/admin-ui-to-disable-users - [`2729a50`](https://github.com/documenso/documenso/commit/2729a50f682a848f0b4b5ddeef726672ba0ecbfc) chore: added back the code removed by mistake - [`968a1e0`](https://github.com/documenso/documenso/commit/968a1e0bddd112ed89df9d304fd4d99e4fcb4ce3) Merge branch 'main' into feat/admin-ui-to-disable-users - [`b6a55ea`](https://github.com/documenso/documenso/commit/b6a55ea63f878faa9d6272aa6b62f19533bad88d) chore: add enable user functionality - [`9a058cc`](https://github.com/documenso/documenso/commit/9a058cca20589590524ec816766f55df4643d002) Merge branch 'main' into feat/admin-ui-to-disable-users ### 📊 Changes **10 files changed** (+451 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `apps/web/src/app/(dashboard)/admin/users/[id]/delete-user-dialog.tsx` (+2 -3) ➕ `apps/web/src/app/(dashboard)/admin/users/[id]/disable-user-dialog.tsx` (+141 -0) ➕ `apps/web/src/app/(dashboard)/admin/users/[id]/enable-user-dialog.tsx` (+130 -0) 📝 `apps/web/src/app/(dashboard)/admin/users/[id]/page.tsx` (+7 -1) 📝 `packages/api/v1/middleware/authenticated.ts` (+20 -4) 📝 `packages/lib/next-auth/get-server-component-session.ts` (+4 -0) ➕ `packages/lib/server-only/user/disable-user.ts` (+69 -0) ➕ `packages/lib/server-only/user/enable-user.ts` (+27 -0) 📝 `packages/trpc/server/admin-router/router.ts` (+39 -4) 📝 `packages/trpc/server/admin-router/schema.ts` (+12 -1) </details> ### 📄 Description My thoughts on how disabling should work. When the user is disabled: - disable the following: - all API keys - set the expiration date to `new Date()` (the current date and time) - all webhooks - set the `enabled` field to `false` - verification tokens (if any) - set the expiration date to `new Date()` (the current date and time) - password reset tokens (if any) - set the expiration date to `new Date()` (the current date and time) - delete the following: - passkeys (if any) What about subscriptions, though? What should we do with the teams created by the disabled user? Any other thoughts? --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 20:30: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#1707
No description provided.