netlify / gotrue

An SWT based API for managing users and issuing SWT tokens.
https://www.gotrueapi.org
MIT License
3.84k stars 285 forks source link

Inconsistent Update User Metadata API #213

Closed smuriu closed 3 years ago

smuriu commented 5 years ago

For updates to user metadata, the user api expects input with the key data. https://github.com/netlify/gotrue/blob/738272dd6983b5993d8be8b8e9c78a37162c94c8/api/user.go#L17

For updates to user metadata, the admin api expects input with the key user_metadata. https://github.com/netlify/gotrue/blob/738272dd6983b5993d8be8b8e9c78a37162c94c8/api/admin.go#L20

The user model will return user_metadata. https://github.com/netlify/gotrue/blob/738272dd6983b5993d8be8b8e9c78a37162c94c8/models/user.go#L45

Perhaps we should adopt a uniform reference to user metadata. user_metadata is less ambiguous/more descriptive than just data especially considering that there is also an app_metadata field in this api too.

smuriu commented 5 years ago

Also see issue #166

swyxio commented 5 years ago

thank you. i'm not the maintainer of this but i think a PR to fix this would be welcome.

mraerino commented 4 years ago

we would need to have a solution that would not involve a breaking change. we cannot simply deprecate the data field as it is used by a lot of people.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had activity in 1 year. It will be closed in 7 days if no further activity occurs. Thanks!

github-actions[bot] commented 3 years ago

This issue was closed because it had no activity for over 1 year.