From 1b593a70e4c83b9eb190ca7c22c048bf4a3ff1be Mon Sep 17 00:00:00 2001 From: Shel Le Date: Thu, 29 Aug 2024 23:22:32 -0700 Subject: [PATCH] password to newUser --- backend/api.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/api.go b/backend/api.go index 0872ec1..4346fc7 100644 --- a/backend/api.go +++ b/backend/api.go @@ -65,11 +65,12 @@ func getSpin(w http.ResponseWriter, r *http.Request) { } -// generate UUID +// get username & password; generate UUID func newUser(w http.ResponseWriter, r *http.Request) { id := uuid.New() username := r.URL.Query().Get("username") + password := r.URL.Query().Get("password") if username == "" { http.Error(w, "USERNAME is required", http.StatusBadRequest) @@ -82,8 +83,9 @@ func newUser(w http.ResponseWriter, r *http.Request) { rdb.ZAdd(ctx, "user_uuid", redis.Z{float64(user_slot), id}).Result() } - // fmt.Println(id.String()) - json.NewEncoder(w).Encode(Message{ID: id.String(), Content: username}) + + c := fmt.Sprint(username, " has password ", password) + json.NewEncoder(w).Encode(Message{ID: id.String(), Content: c}) } // this user, this amount, this type of bet, this roulette number