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
The UserProfileForm has a hard dependency on a route that must be implemented by the developer in their backend server. Right now it is hard-coded to post to the /me endpoint, which creates confusion because the Client API (and current framework integrations) provide this as a read-only endpoint that does not accept a POST. It is up to the developer to implement their own route for modifying the user object, in our other examples we show the developer how to setup a /profile route for this purpose.
I think this component should be removed from the core SDK and moved into an example project, but I'm open to other ideas. At the very least, the endpoint needs to be changed from /me to remove confusion with our read-only endpoint, changing it to /profile would be the most congruent.
Not really my discussion, but since I saw the issue... While a hard-coded route certainly does not make too much sense, I suspect the standard profile update form is such a common requirement that it makes little sense to remove it entirely. People will probably just fall back to using modified versions from the current version if it's removed. Why not just make the endpoint a required property for the component, so that the user can use it if and only if they decide to define the endpoint to target and then pass it to the update method? As in:
Okay, I agree with leaving UserProfileForm in this library, and making endpoint a required property, and undefined by default. If endpoint is not defined when we try to submit the form, we should error and tell the developer why we can't submit the form.
Activity
the-overengineer commentedon Jan 26, 2017
Not really my discussion, but since I saw the issue... While a hard-coded route certainly does not make too much sense, I suspect the standard profile update form is such a common requirement that it makes little sense to remove it entirely. People will probably just fall back to using modified versions from the current version if it's removed. Why not just make the endpoint a required property for the component, so that the user can use it if and only if they decide to define the endpoint to target and then pass it to the update method? As in:
rorheden commentedon Jan 26, 2017
I fully agree with @Tweety-FER. I think it's better just to remove the dependency of the
/meendpoint, and force the users to specify their own.the-overengineer commentedon Jan 26, 2017
Regarding that, just made a semi-related PR. Support for this could be added simply by adding a
.isRequiredto the end of https://github.com/stormpath/stormpath-sdk-react/blob/feature/form-custom-req-settings/src/components/UserProfileForm.js#L87robertjd commentedon Feb 1, 2017
Okay, I agree with leaving
UserProfileFormin this library, and makingendpointa required property, and undefined by default. Ifendpointis not defined when we try to submit the form, we should error and tell the developer why we can't submit the form.