[PR #672] [MERGED] feat: self-service user signup #674

Closed
opened 2025-10-07 00:20:26 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/pocket-id/pocket-id/pull/672
Author: @kmendell
Created: 6/23/2025
Status: Merged
Merged: 6/27/2025
Merged by: @kmendell

Base: mainHead: feat/user-signup


📝 Commits (10+)

  • 49cba53 feat: self-service user signup
  • 5da051d add audit log entry
  • 7234fab simplify dropdown button
  • 5a3d4c8 add configuration options for enabling/disabling user signups
  • b2ca939 add signup token list modal
  • e605193 make allowUserSignups not required
  • b7fe43a chore: run formatter
  • be15ecc Merge branch 'main' into feat/user-signup
  • 2ed64f8 fix token table sorting and model definition
  • b108a64 move signup to its own route

📊 Changes

49 files changed (+7385 additions, -5748 deletions)

View changed files

📝 backend/internal/common/errors.go (+10 -0)
📝 backend/internal/controller/user_controller.go (+128 -0)
📝 backend/internal/dto/app_config_dto.go (+1 -0)
backend/internal/dto/signup_token_dto.go (+21 -0)
📝 backend/internal/dto/user_dto.go (+8 -0)
📝 backend/internal/job/db_cleanup_job.go (+16 -0)
📝 backend/internal/model/app_config.go (+1 -0)
📝 backend/internal/model/audit_log.go (+1 -0)
backend/internal/model/signup_token.go (+28 -0)
📝 backend/internal/service/app_config_service.go (+1 -0)
📝 backend/internal/service/e2etest_service.go (+44 -0)
📝 backend/internal/service/user_service.go (+121 -0)
backend/resources/migrations/postgres/20250622151258_add_signup_tokens.down.sql (+3 -0)
backend/resources/migrations/postgres/20250622151258_add_signup_tokens.up.sql (+11 -0)
backend/resources/migrations/sqlite/20250622151258_add_signup_tokens.down.sql (+3 -0)
backend/resources/migrations/sqlite/20250622151258_add_signup_tokens.up.sql (+11 -0)
📝 frontend/messages/en.json (+40 -2)
📝 frontend/package-lock.json (+5496 -5505)
📝 frontend/package.json (+58 -58)
📝 frontend/src/lib/components/form/form-input.svelte (+1 -1)

...and 29 more files

📄 Description

Fixes: https://github.com/pocket-id/pocket-id/issues/358

This works similarly to the login codes.

  • An admin can create a Signup Token Link with a customizable Expiration and Usage Limit.
    image

  • Users can use this link to create their account and initial passkey.

TODOS:

  • Make a configurable "Opt-in" switch to allow signups

  • Create Audit log events when a signup takes place with the generated links.

  • Create E2E Tests to cover User Signups

  • Add a way to view active Signup token links
    image

  • Configuration Settings for "Signup Disabled, Signup with Token, or Open Signup"


🔄 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/pocket-id/pocket-id/pull/672 **Author:** [@kmendell](https://github.com/kmendell) **Created:** 6/23/2025 **Status:** ✅ Merged **Merged:** 6/27/2025 **Merged by:** [@kmendell](https://github.com/kmendell) **Base:** `main` ← **Head:** `feat/user-signup` --- ### 📝 Commits (10+) - [`49cba53`](https://github.com/pocket-id/pocket-id/commit/49cba53fd0ec646df6cf7f72a755854339a6a5fd) feat: self-service user signup - [`5da051d`](https://github.com/pocket-id/pocket-id/commit/5da051d3b504d97a020172667d6d0d3731054811) add audit log entry - [`7234fab`](https://github.com/pocket-id/pocket-id/commit/7234fab86fd527f9419ee8eb38d720c751850b97) simplify dropdown button - [`5a3d4c8`](https://github.com/pocket-id/pocket-id/commit/5a3d4c8154922e86066ff220a09daafa0ce3de97) add configuration options for enabling/disabling user signups - [`b2ca939`](https://github.com/pocket-id/pocket-id/commit/b2ca9397993e38ea14d0cb00e20c6f5074c73de5) add signup token list modal - [`e605193`](https://github.com/pocket-id/pocket-id/commit/e605193ba725f159dec30d2855fb7436dfa820bc) make allowUserSignups not required - [`b7fe43a`](https://github.com/pocket-id/pocket-id/commit/b7fe43a0a6ed7ac90f7b6faa4e7337df7de5ce70) chore: run formatter - [`be15ecc`](https://github.com/pocket-id/pocket-id/commit/be15eccea72512278ff1fce40c010ff50d34642f) Merge branch 'main' into feat/user-signup - [`2ed64f8`](https://github.com/pocket-id/pocket-id/commit/2ed64f82847d9a4c4395739a7a0f560b2dbd643e) fix token table sorting and model definition - [`b108a64`](https://github.com/pocket-id/pocket-id/commit/b108a6448ebe3efa4473bcc50ac9abaece1975af) move signup to its own route ### 📊 Changes **49 files changed** (+7385 additions, -5748 deletions) <details> <summary>View changed files</summary> 📝 `backend/internal/common/errors.go` (+10 -0) 📝 `backend/internal/controller/user_controller.go` (+128 -0) 📝 `backend/internal/dto/app_config_dto.go` (+1 -0) ➕ `backend/internal/dto/signup_token_dto.go` (+21 -0) 📝 `backend/internal/dto/user_dto.go` (+8 -0) 📝 `backend/internal/job/db_cleanup_job.go` (+16 -0) 📝 `backend/internal/model/app_config.go` (+1 -0) 📝 `backend/internal/model/audit_log.go` (+1 -0) ➕ `backend/internal/model/signup_token.go` (+28 -0) 📝 `backend/internal/service/app_config_service.go` (+1 -0) 📝 `backend/internal/service/e2etest_service.go` (+44 -0) 📝 `backend/internal/service/user_service.go` (+121 -0) ➕ `backend/resources/migrations/postgres/20250622151258_add_signup_tokens.down.sql` (+3 -0) ➕ `backend/resources/migrations/postgres/20250622151258_add_signup_tokens.up.sql` (+11 -0) ➕ `backend/resources/migrations/sqlite/20250622151258_add_signup_tokens.down.sql` (+3 -0) ➕ `backend/resources/migrations/sqlite/20250622151258_add_signup_tokens.up.sql` (+11 -0) 📝 `frontend/messages/en.json` (+40 -2) 📝 `frontend/package-lock.json` (+5496 -5505) 📝 `frontend/package.json` (+58 -58) 📝 `frontend/src/lib/components/form/form-input.svelte` (+1 -1) _...and 29 more files_ </details> ### 📄 Description Fixes: https://github.com/pocket-id/pocket-id/issues/358 This works similarly to the login codes. - An admin can create a Signup Token Link with a customizable Expiration and Usage Limit. <img width="240" alt="image" src="https://github.com/user-attachments/assets/4b42afa0-8343-49e2-93ce-39b782ea5034" /> - Users can use this link to create their account and initial passkey. # TODOS: - [x] Make a configurable "Opt-in" switch to allow signups - [x] Create Audit log events when a signup takes place with the generated links. - [x] Create E2E Tests to cover User Signups - [x] Add a way to view active Signup token links <img width="240" alt="image" src="https://github.com/user-attachments/assets/141726c4-33dd-46e3-aa4f-d919fb00361f" /> - [x] Configuration Settings for "Signup Disabled, Signup with Token, or Open Signup" --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2025-10-07 00:20:26 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id#674