mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-07-16 05:54:01 +03:00
[PR #271] [MERGED] feat(account): allow creation of own login codes #705
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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:
main← Head:feat/account/create_own_one-time_links📝 Commits (7)
0acf7fechore(frontend): update package-lock to same version as package.jsonf3b9a31refactor: move one-time link modal to generic components0ed51d7feat(account): allow user to create own one-time links46fee49test(account): test creation of own one time link for non admins5056f6cchange create code ui and allow to enter code manually6e92e80remove redirect url if initiated by login page9cab88ffix 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.