[PR #1694] [MERGED] Allow edited access tokens to be set to never expire #1693

Closed
opened 2026-05-07 01:03:16 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/binwiederhier/ntfy/pull/1694
Author: @ShipItAndPray
Created: 4/9/2026
Status: Merged
Merged: 4/11/2026
Merged by: @binwiederhier

Base: mainHead: fix/token-expiration-never-edit


📝 Commits (1)

  • 4b0a4ee web: allow setting token expiration to never when editing

📊 Changes

2 files changed (+11 additions, -2 deletions)

View changed files

📝 server/server_account_test.go (+9 -0)
📝 web/src/app/AccountApi.js (+2 -2)

📄 Description

Summary

This fixes the web account token editor so an existing token can be changed to never expire.

Before this change, the edit dialog offered a "never" option, but the PATCH request omitted the expires field when 0 was selected. The server interpreted that as "leave unchanged", so the expiration could only be moved to a future timestamp, not to no expiration.

Changes included:

  • send expires: 0 from the web client when the edit dialog selects "never"
  • add a server regression test covering PATCH /v1/account/token with expires: 0

Closes #1693.

Validation

  • git diff --check
  • cd web && npm ci
  • cd web && npm run lint -- --ext .js,.jsx ./src/app/AccountApi.js ./src/components/Account.jsx

Notes:

  • The local Go toolchain in this environment is go1.13, while the repo declares go 1.25.0, so I did not claim a meaningful local go test run from this machine.

🔄 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/binwiederhier/ntfy/pull/1694 **Author:** [@ShipItAndPray](https://github.com/ShipItAndPray) **Created:** 4/9/2026 **Status:** ✅ Merged **Merged:** 4/11/2026 **Merged by:** [@binwiederhier](https://github.com/binwiederhier) **Base:** `main` ← **Head:** `fix/token-expiration-never-edit` --- ### 📝 Commits (1) - [`4b0a4ee`](https://github.com/binwiederhier/ntfy/commit/4b0a4eee3b8dba4ae033d102631a6a0c87ecc5d5) web: allow setting token expiration to never when editing ### 📊 Changes **2 files changed** (+11 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `server/server_account_test.go` (+9 -0) 📝 `web/src/app/AccountApi.js` (+2 -2) </details> ### 📄 Description ## Summary This fixes the web account token editor so an existing token can be changed to never expire. Before this change, the edit dialog offered a "never" option, but the PATCH request omitted the `expires` field when `0` was selected. The server interpreted that as "leave unchanged", so the expiration could only be moved to a future timestamp, not to no expiration. Changes included: - send `expires: 0` from the web client when the edit dialog selects "never" - add a server regression test covering `PATCH /v1/account/token` with `expires: 0` Closes #1693. ## Validation - `git diff --check` - `cd web && npm ci` - `cd web && npm run lint -- --ext .js,.jsx ./src/app/AccountApi.js ./src/components/Account.jsx` Notes: - The local Go toolchain in this environment is `go1.13`, while the repo declares `go 1.25.0`, so I did not claim a meaningful local `go test` run from this machine. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 01:03:16 +02: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/ntfy#1693
No description provided.