api: update commenter information on new login
This commit is contained in:
@@ -96,7 +96,6 @@ func ssoCallbackHandler(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
var commenterHex string
|
||||
|
||||
// TODO: in case of returning users, update the information we have on record?
|
||||
if err == errorNoSuchCommenter {
|
||||
commenterHex, err = commenterNew(payload.Email, payload.Name, payload.Link, payload.Photo, "sso:"+domain, "")
|
||||
if err != nil {
|
||||
@@ -104,6 +103,11 @@ func ssoCallbackHandler(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if err = commenterUpdate(c.CommenterHex, payload.Email, payload.Name, payload.Link, payload.Photo, "sso:"+domain); err != nil {
|
||||
logger.Warningf("cannot update commenter: %s", err)
|
||||
// not a serious enough to exit with an error
|
||||
}
|
||||
|
||||
commenterHex = c.CommenterHex
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user