mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-09 14:53:00 +03:00
🐛 Bug Report: LDAP Users Unable to Update Language Settings Due to Update Restriction #247
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?
Originally created by @Star-caorui on GitHub.
Originally assigned to: @kmendell on GitHub.
Reproduction steps
LdapEnabled = true).LdapIDset to a non-nil value)./api/users/meendpoint (e.g.,PUT /api/users/mewith a payload updating theLocalefield).Description
When an LDAP user attempts to update their language settings (or any personal information) through the
/api/users/meendpoint, the operation fails with a403 Forbiddenerror. The error message indicates that "LDAP users can't be updated," which prevents LDAP users from making even non-critical updates like changing their language preference.This issue arises because the current implementation in
user_service.gorestricts all updates for LDAP users when LDAP is enabled, unless the update is performed via an LDAP sync operation. While this restriction might be intended to protect critical user data, it also blocks benign updates such as language preferences, which should ideally be allowed for LDAP users.Relevant Code Location
The error is triggered at:
updateUserInternaldisallows updates for LDAP users if the operation is not an LDAP sync and LDAP is enabled:Expected behavior
Locale), even when LDAP is enabled.Email,Username) and non-critical fields (e.g.,Locale), allowing updates to the latter.Actual Behavior
403 Forbiddenstatus code.Version and Environment
Log Output
@stonith404 commented on GitHub:
Thanks for reporting this. This should be fixed in
v0.51.1.