netlify/gotrue

Inconsistent Update User Metadata API

smuriu opened this issue ยท 5 comments

For updates to user metadata, the user api expects input with the key data.

Data map[string]interface{} `json:"data"`

For updates to user metadata, the admin api expects input with the key user_metadata.

UserMetaData map[string]interface{} `json:"user_metadata"`

The user model will return user_metadata.

UserMetaData JSONMap `json:"user_metadata" db:"raw_user_meta_data"`

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.

Also see issue #166

sw-yx commented

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

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.

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!

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