From bbea9df8b8b40a39b05ef11831105e635c91bde1 Mon Sep 17 00:00:00 2001 From: Ricky Panzer Date: Thu, 13 Feb 2020 16:13:14 +0000 Subject: [PATCH] commenter_login.go: include email in response Fixes https://gitlab.com/commento/commento/issues/271 --- api/commenter_login.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/commenter_login.go b/api/commenter_login.go index 6b04905..b5ec68a 100644 --- a/api/commenter_login.go +++ b/api/commenter_login.go @@ -74,5 +74,11 @@ func commenterLoginHandler(w http.ResponseWriter, r *http.Request) { 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}) }