From 0acdd67e398a08bf886111777d4419fe8b5fa9ea Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Wed, 13 Feb 2019 00:50:27 -0500 Subject: [PATCH] commenter_login.go: include commenter struct in response --- api/commenter_login.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/commenter_login.go b/api/commenter_login.go index c127eec..6b04905 100644 --- a/api/commenter_login.go +++ b/api/commenter_login.go @@ -67,5 +67,12 @@ func commenterLoginHandler(w http.ResponseWriter, r *http.Request) { return } - bodyMarshal(w, response{"success": true, "commenterToken": commenterToken}) + // TODO: modify commenterLogin to directly return c? + c, err := commenterGetByCommenterToken(commenterToken) + if err != nil { + bodyMarshal(w, response{"success": false, "message": err.Error()}) + return + } + + bodyMarshal(w, response{"success": true, "commenterToken": commenterToken, "commenter": c}) }