mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-09 14:53:00 +03:00
[PR #855] [MERGED] fix: for one-time access tokens and signup tokens, pass TTLs instead of absolute expiration date #587
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/855
Author: @ItalyPaleAle
Created: 8/20/2025
Status: ✅ Merged
Merged: 8/22/2025
Merged by: @stonith404
Base:
main← Head:fix-804📝 Commits (5)
adce7a7fix: for one-time access tokens, pass TTLs instead of absolute expiration datecdb3c22Merge branch 'main' into fix-80497380c2Move validation object to a custom validator2db0bc8Use TTL logic for signup tokens too31a9909Merge branch 'main' into fix-804📊 Changes
12 files changed (+204 additions, -69 deletions)
View changed files
📝
backend/internal/cmds/one_time_access_token.go(+1 -1)📝
backend/internal/controller/user_controller.go(+26 -4)📝
backend/internal/dto/signup_token_dto.go(+3 -4)📝
backend/internal/dto/user_dto.go(+4 -4)📝
backend/internal/dto/validations.go(+28 -15)📝
backend/internal/service/user_service.go(+23 -24)➕
backend/internal/utils/json_util.go(+42 -0)➕
backend/internal/utils/json_util_test.go(+64 -0)📝
frontend/src/lib/components/one-time-link-modal.svelte(+4 -6)📝
frontend/src/lib/components/signup/signup-token-modal.svelte(+1 -2)📝
frontend/src/lib/services/user-service.ts(+6 -6)📝
frontend/src/routes/settings/account/login-code-modal.svelte(+2 -3)📄 Description
Fixes #804
We perform computations on expiration times on the server, which means that:
Also, enforces a maximum TTL, server-side, of 31 days, even for people making direct API calls (the UI was not allowing more than 30 days already)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.