api, frontend: restrict profile updates to commento provider

This commit is contained in:
Adhityaa Chandrasekar
2020-02-13 20:11:47 -05:00
parent b7c214e910
commit 986b05f89a
3 changed files with 7 additions and 3 deletions

View File

@@ -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 {