repos / pico

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

commit
00dc4ec
parent
37dd63a
author
Eric Bower
date
2024-05-28 19:15:39 +0000 UTC
fix(imgs): user can be nil
1 files changed,  +5, -3
M imgs/ssh.go
+5, -3
 1@@ -55,11 +55,13 @@ func AuthHandler(dbh db.DB, log *slog.Logger) func(ssh.Context, ssh.PublicKey) b
 2 			return false
 3 		}
 4 
 5-		if user != nil {
 6-			setUserCtx(ctx, user)
 7-			return true
 8+		if user == nil {
 9+			log.Error("user not found", "err", err)
10+			return false
11 		}
12 
13+		setUserCtx(ctx, user)
14+
15 		if !dbh.HasFeatureForUser(user.ID, "plus") {
16 			log.Error("not a pico+ user", "user", user.Name)
17 			return false