Soe Thu 5 years ago
parent
commit
7fdec386a6
1 changed files with 8 additions and 1 deletions
  1. 8 1
      test.go

+ 8 - 1
test.go

@@ -41,6 +41,13 @@ func Login(w http.ResponseWriter, r *http.Request) {
 		http.Error(w, err.Error(), 500)
 		return
 	}
-	fmt.Fprint(w, usr)
+	log.Printf("Parse User login.", usr)
+	bty, err := json.Marshal(usr)
+	if err != nil {
+		log.Printf("[ERROR] Marshal %s.", err.Error())
+		http.Error(w, err.Error(), 500)
+		return
+	}
+	fmt.Fprint(w, bty)
 	log.Printf("End login.")
 }