diff --git a/api/commenter_update.go b/api/commenter_update.go index 388a07f..a815a96 100644 --- a/api/commenter_update.go +++ b/api/commenter_update.go @@ -54,9 +54,10 @@ func commenterUpdateHandler(w http.ResponseWriter, r *http.Request) { } if c.Provider != "commento" { - *x.Link = c.Link - *x.Photo = c.Photo + bodyMarshal(w, response{"success": false, "message": errorCannotUpdateOauthProfile.Error()}) + return } + *x.Email = c.Email if err = commenterUpdate(c.CommenterHex, *x.Email, *x.Name, *x.Link, *x.Photo, c.Provider); err != nil { diff --git a/api/errors.go b/api/errors.go index 2d6b5cc..3ccebc8 100644 --- a/api/errors.go +++ b/api/errors.go @@ -49,3 +49,4 @@ var errorInvalidDomain = errors.New("Invalid domain name. Do not include the URL var errorInvalidEntity = errors.New("That entity does not exist.") var errorCannotDeleteOwnerWithActiveDomains = errors.New("You cannot delete your account until all domains associated with your account are deleted.") var errorNoSuchOwner = errors.New("No such owner.") +var errorCannotUpdateOauthProfile = errors.New("You cannot update the profile of an external account managed by third-party log in. Please use the appropriate platform to update your details.") diff --git a/frontend/js/commento.js b/frontend/js/commento.js index 903db83..2dfdc67 100644 --- a/frontend/js/commento.js +++ b/frontend/js/commento.js @@ -314,7 +314,9 @@ append(loggedInAs, name); append(loggedContainer, loggedInAs); append(loggedContainer, logoutButton); - append(loggedContainer, profileEditButton); + if (commenter.provider === "commento") { + append(loggedContainer, profileEditButton); + } append(loggedContainer, notificationSettingsButton); prepend(root, loggedContainer);