[PR #271] [MERGED] feat(account): allow creation of own login codes #705

Closed
opened 2026-02-04 20:48:28 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/pocket-id/pocket-id/pull/271
Author: @Pyxels
Created: 2/26/2025
Status: Merged
Merged: 3/10/2025
Merged by: @stonith404

Base: mainHead: feat/account/create_own_one-time_links


📝 Commits (7)

  • 0acf7fe chore(frontend): update package-lock to same version as package.json
  • f3b9a31 refactor: move one-time link modal to generic components
  • 0ed51d7 feat(account): allow user to create own one-time links
  • 46fee49 test(account): test creation of own one time link for non admins
  • 5056f6c change create code ui and allow to enter code manually
  • 6e92e80 remove redirect url if initiated by login page
  • 9cab88f fix origin in url alias

📊 Changes

34 files changed (+444 additions, -189 deletions)

View changed files

📝 backend/internal/common/errors.go (+7 -0)
📝 backend/internal/controller/app_config_controller.go (+1 -1)
📝 backend/internal/controller/user_controller.go (+14 -2)
📝 backend/internal/dto/user_dto.go (+1 -1)
📝 backend/internal/service/email_service_templates.go (+4 -2)
📝 backend/internal/service/user_service.go (+20 -5)
📝 backend/resources/email-templates/one-time-access_html.tmpl (+3 -3)
📝 backend/resources/email-templates/one-time-access_text.tmpl (+5 -3)
📝 frontend/package-lock.json (+2 -2)
📝 frontend/src/hooks.server.ts (+1 -1)
📝 frontend/src/lib/components/copy-to-clipboard.svelte (+1 -1)
📝 frontend/src/lib/components/login-wrapper.svelte (+35 -47)
📝 frontend/src/lib/components/one-time-link-modal.svelte (+8 -9)
📝 frontend/src/lib/components/web-authn-unsupported.svelte (+4 -4)
📝 frontend/src/lib/services/user-service.ts (+1 -1)
📝 frontend/src/routes/authorize/+page.svelte (+1 -1)
frontend/src/routes/lc/+server.ts (+10 -0)
frontend/src/routes/lc/[code]/+server.ts (+15 -0)
📝 frontend/src/routes/login/+page.svelte (+4 -4)
frontend/src/routes/login/[token]/+page.svelte (+0 -69)

...and 14 more files

📄 Description

Feature description

Adds button to allow users to create their own One-time links.

Motivation

As a user I might want to add new devices with their own passkey. Currently I need an admin to create that One-time link for me, this PR allows the users to create their own links.

(See the relevant discussion #95)


I tried to implement this as minimally invasive as possible, thus I completely reused the admin component and moved it into the lib. Beware, I also slightly changed the info text on the popup, to be universally correct for admins and users creating their own links.

Please let me know if you'd like this handled differently!


🔄 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/271 **Author:** [@Pyxels](https://github.com/Pyxels) **Created:** 2/26/2025 **Status:** ✅ Merged **Merged:** 3/10/2025 **Merged by:** [@stonith404](https://github.com/stonith404) **Base:** `main` ← **Head:** `feat/account/create_own_one-time_links` --- ### 📝 Commits (7) - [`0acf7fe`](https://github.com/pocket-id/pocket-id/commit/0acf7fe5e4a0634190c45c44c02ece5347dde48e) chore(frontend): update package-lock to same version as package.json - [`f3b9a31`](https://github.com/pocket-id/pocket-id/commit/f3b9a31476482ac60b26b2484d570d0d7749ff3e) refactor: move one-time link modal to generic components - [`0ed51d7`](https://github.com/pocket-id/pocket-id/commit/0ed51d7b908f99b81750ff19e9e09e0babb2eeee) feat(account): allow user to create own one-time links - [`46fee49`](https://github.com/pocket-id/pocket-id/commit/46fee4921aee79e82498323a567253b003add995) test(account): test creation of own one time link for non admins - [`5056f6c`](https://github.com/pocket-id/pocket-id/commit/5056f6c41ddcd90b800a3cce8224f870961c1281) change create code ui and allow to enter code manually - [`6e92e80`](https://github.com/pocket-id/pocket-id/commit/6e92e80c1eff39ebc85bf21f5472069871905b54) remove redirect url if initiated by login page - [`9cab88f`](https://github.com/pocket-id/pocket-id/commit/9cab88fa9d50c7400a0d495d34b9d07a7928d9e2) fix origin in url alias ### 📊 Changes **34 files changed** (+444 additions, -189 deletions) <details> <summary>View changed files</summary> 📝 `backend/internal/common/errors.go` (+7 -0) 📝 `backend/internal/controller/app_config_controller.go` (+1 -1) 📝 `backend/internal/controller/user_controller.go` (+14 -2) 📝 `backend/internal/dto/user_dto.go` (+1 -1) 📝 `backend/internal/service/email_service_templates.go` (+4 -2) 📝 `backend/internal/service/user_service.go` (+20 -5) 📝 `backend/resources/email-templates/one-time-access_html.tmpl` (+3 -3) 📝 `backend/resources/email-templates/one-time-access_text.tmpl` (+5 -3) 📝 `frontend/package-lock.json` (+2 -2) 📝 `frontend/src/hooks.server.ts` (+1 -1) 📝 `frontend/src/lib/components/copy-to-clipboard.svelte` (+1 -1) 📝 `frontend/src/lib/components/login-wrapper.svelte` (+35 -47) 📝 `frontend/src/lib/components/one-time-link-modal.svelte` (+8 -9) 📝 `frontend/src/lib/components/web-authn-unsupported.svelte` (+4 -4) 📝 `frontend/src/lib/services/user-service.ts` (+1 -1) 📝 `frontend/src/routes/authorize/+page.svelte` (+1 -1) ➕ `frontend/src/routes/lc/+server.ts` (+10 -0) ➕ `frontend/src/routes/lc/[code]/+server.ts` (+15 -0) 📝 `frontend/src/routes/login/+page.svelte` (+4 -4) ➖ `frontend/src/routes/login/[token]/+page.svelte` (+0 -69) _...and 14 more files_ </details> ### 📄 Description ## Feature description Adds button to allow users to create their own One-time links. ## Motivation As a user I might want to add new devices with their own passkey. Currently I need an admin to create that One-time link for me, this PR allows the users to create their own links. (See the relevant discussion #95) --- I tried to implement this as minimally invasive as possible, thus I completely reused the admin component and moved it into the lib. Beware, I also slightly changed the info text on the popup, to be universally correct for admins and users creating their own links. Please let me know if you'd like this handled differently! --- <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 2026-02-04 20:48:28 +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#705