You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
broken.movfixed.mov
I seem to lack the appropriate permissions to open a PR for this repo, but the diff that fixes this is included below:
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:
broken.mov
fixed.mov
I seem to lack the appropriate permissions to open a PR for this repo, but the diff that fixes this is included below:
The text was updated successfully, but these errors were encountered: