commenter_login.go: include commenter struct in response

This commit is contained in:
Adhityaa Chandrasekar 2019-02-13 00:50:27 -05:00
parent caca7b8c41
commit 0acdd67e39

View File

@ -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})
}