When using the Netbird dashboard UI to make changes to the "Settings" tabs, specifically under "Authentication" (/src/modules/settings/AuthenticationTab.tsx) a PUT call is made to /api/accounts/{accountid}that contains only the values from the current screen, which overwrites and blanks out the other values for /api/accounts/{accountid} from Groups & Permissions
In the included video "broken.mov" you can see that groups settings are in place and active, then a change is made only to the "expires in" value on the Authentication tab, and the resulting payload does not include values for jwt_allow_groups, jwt_groups_claim_name, jwt_groups_enabled and regular_users_view_blocked.
The response payload confirms that those values, previously set, have now been erased. While some APIs do implement a patch-like mechanism for PUT calls, it appears Netbird management does not, and thus the whole object is replaced with the values declared in the PUT call. A solution could be to migrate to a PATCH call, but my proposed change will fix this without changes to the API.
Solution:
Establish the other parameters in the state for AuthenticationTab.tsx and include with the PUT request.
Attached video "fixed.mov" shows that the API response now contains all the values correctly, and the Groups & Permissions values are not erased from the UI.
Issue:
When using the Netbird dashboard UI to make changes to the "Settings" tabs, specifically under "Authentication" (
/src/modules/settings/AuthenticationTab.tsx
) a PUT call is made to/api/accounts/{accountid}
that contains only the values from the current screen, which overwrites and blanks out the other values for/api/accounts/{accountid}
from Groups & PermissionsIn the included video "broken.mov" you can see that groups settings are in place and active, then a change is made only to the "expires in" value on the Authentication tab, and the resulting payload does not include values for
jwt_allow_groups, jwt_groups_claim_name, jwt_groups_enabled and regular_users_view_blocked
.The response payload confirms that those values, previously set, have now been erased. While some APIs do implement a patch-like mechanism for PUT calls, it appears Netbird management does not, and thus the whole object is replaced with the values declared in the PUT call. A solution could be to migrate to a PATCH call, but my proposed change will fix this without changes to the API.
Solution:
https://github.com/user-attachments/assets/aec673c8-e7c6-43ea-a822-d9b54a2cdbec
https://github.com/user-attachments/assets/cb96112a-b0c5-4f9f-b42d-e7946694bb1b
I seem to lack the appropriate permissions to open a PR for this repo, but the diff that fixes this is included below: