Skip to content

Commit

Permalink
fix(pipe): use public key to find user
Browse files Browse the repository at this point in the history
  • Loading branch information
neurosnap committed Dec 13, 2024
1 parent c59051f commit 2fd228b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pipe/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/picosh/pico/db"
"github.com/picosh/pico/shared"
psub "github.com/picosh/pubsub"
"github.com/picosh/utils"
gossh "golang.org/x/crypto/ssh"
)

Expand Down Expand Up @@ -141,7 +142,8 @@ func WishMiddleware(handler *CliHandler) wish.Middleware {
logger := handler.Logger
ctx := sesh.Context()

user, err := handler.DBPool.FindUser(sesh.Permissions().Extensions["user_id"])
pubkey := utils.KeyForKeyText(sesh.PublicKey())
user, err := handler.DBPool.FindUserForKey(sesh.User(), pubkey)
if err != nil {
logger.Info("user not found", "err", err)
}
Expand Down

0 comments on commit 2fd228b

Please sign in to comment.