commenter_login.go: include email in response

Fixes https://gitlab.com/commento/commento/issues/271
This commit is contained in:
Ricky Panzer 2020-02-13 16:13:14 +00:00 committed by Adhityaa Chandrasekar
parent 44dd4fa00c
commit bbea9df8b8

View File

@ -74,5 +74,11 @@ func commenterLoginHandler(w http.ResponseWriter, r *http.Request) {
return return
} }
bodyMarshal(w, response{"success": true, "commenterToken": commenterToken, "commenter": c}) e, err := emailGet(c.Email)
if err != nil {
bodyMarshal(w, response{"success": false, "message": err.Error()})
return
}
bodyMarshal(w, response{"success": true, "commenterToken": commenterToken, "commenter": c, "email": e})
} }