repos / pico

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

commit
2fd228b
parent
c59051f
author
Eric Bower
date
2024-12-13 16:42:51 +0000 UTC
fix(pipe): use public key to find user
1 files changed,  +3, -1
M pipe/cli.go
+3, -1
 1@@ -19,6 +19,7 @@ import (
 2 	"github.com/picosh/pico/db"
 3 	"github.com/picosh/pico/shared"
 4 	psub "github.com/picosh/pubsub"
 5+	"github.com/picosh/utils"
 6 	gossh "golang.org/x/crypto/ssh"
 7 )
 8 
 9@@ -141,7 +142,8 @@ func WishMiddleware(handler *CliHandler) wish.Middleware {
10 			logger := handler.Logger
11 			ctx := sesh.Context()
12 
13-			user, err := handler.DBPool.FindUser(sesh.Permissions().Extensions["user_id"])
14+			pubkey := utils.KeyForKeyText(sesh.PublicKey())
15+			user, err := handler.DBPool.FindUserForKey(sesh.User(), pubkey)
16 			if err != nil {
17 				logger.Info("user not found", "err", err)
18 			}