mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[PR #1267] [MERGED] Api change user password #1555
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#1555
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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/binwiederhier/ntfy/pull/1267
Author: @wunter8
Created: 1/26/2025
Status: ✅ Merged
Merged: 5/24/2025
Merged by: @binwiederhier
Base:
main← Head:api-change-user-password📝 Commits (6)
8f9dafcchange user password via accounts APIad7ab18prevent changing admin passwords2b40ad9make staticcheck happyfa48639make POST create user and PUT update usere36e485allow changing password or tier with user PUT0fb60aetest change user password and tier in single request📊 Changes
5 files changed (+211 additions, -7 deletions)
View changed files
📝
docs/releases.md(+1 -0)📝
server/server.go(+3 -1)📝
server/server_admin.go(+43 -1)📝
server/server_admin_test.go(+163 -4)📝
server/types.go(+1 -1)📄 Description
I'm not sure if this is the best way to implement this, but I added a
forceparam to the "add user" request.If
force == true, it will override the password of an existing user (instead of it causing an error saying that a user already exists).This will let you change a user's password and preserve the user ID in the database (instead of deleting a user and then creating a new one with the same username)
The "add user" endpoint already requires admin credentials to use, and admins can create and delete users, so I didn't think changing a user's password would be much different.
Admins CANNOT change the password of another admin.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.