repos / pico

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

commit
5e27647
parent
de86b34
author
Antonio Mika
date
2024-11-18 23:19:07 +0000 UTC
Don't require space
1 files changed,  +1, -6
M auth/api.go
+1, -6
 1@@ -284,11 +284,6 @@ func keyHandler(w http.ResponseWriter, r *http.Request) {
 2 	}
 3 
 4 	space := r.URL.Query().Get("space")
 5-	if space == "" {
 6-		spaceErr := fmt.Errorf("must provide `space` query parameter")
 7-		client.Logger.Error(spaceErr.Error())
 8-		http.Error(w, spaceErr.Error(), http.StatusUnprocessableEntity)
 9-	}
10 
11 	client.Logger.Info(
12 		"handle key",
13@@ -301,7 +296,7 @@ func keyHandler(w http.ResponseWriter, r *http.Request) {
14 	user, err := client.Dbpool.FindUserForKey(data.Username, data.PublicKey)
15 	if err != nil {
16 		client.Logger.Error(err.Error())
17-		http.Error(w, err.Error(), http.StatusUnauthorized)
18+		w.WriteHeader(http.StatusUnauthorized)
19 		return
20 	}
21