repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
252dc3d
parent
2be62f3
author
Antonio Mika
date
2024-08-27 04:12:04 +0000 UTC
Send keys for user info
1 files changed,  +8, -1
M auth/api.go
+8, -1
 1@@ -329,9 +329,16 @@ func userHandler(w http.ResponseWriter, r *http.Request) {
 2 		return
 3 	}
 4 
 5+	keys, err := client.Dbpool.FindKeysForUser(user)
 6+	if err != nil {
 7+		client.Logger.Error(err.Error())
 8+		http.Error(w, err.Error(), http.StatusNotFound)
 9+		return
10+	}
11+
12 	w.Header().Set("Content-Type", "application/json")
13 	w.WriteHeader(http.StatusOK)
14-	err = json.NewEncoder(w).Encode(user)
15+	err = json.NewEncoder(w).Encode(keys)
16 	if err != nil {
17 		client.Logger.Error(err.Error())
18 		http.Error(w, err.Error(), http.StatusInternalServerError)