Skip to content

Commit b3bfa1a

Browse files
authored
trim spaces from auth token (#10)
This is useful because sometimes on copy/pasting the token there is a leading or trailing space. This is more tolerant and accepts tokens that inadvertently have leading or trailing spaces. Signed-off-by: 8go <[email protected]>
1 parent 7a09a3f commit b3bfa1a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/wush/cp.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"net/netip"
1111
"os"
1212
"path/filepath"
13+
"strings"
1314

1415
"github.com/charmbracelet/huh"
1516
"github.com/coder/serpent"
@@ -54,7 +55,7 @@ func initAuth(authFlag *string, ca *overlay.ClientAuth) serpent.MiddlewareFunc {
5455
}
5556
}
5657

57-
err := ca.Parse(*authFlag)
58+
err := ca.Parse(strings.TrimSpace(*authFlag))
5859
if err != nil {
5960
return fmt.Errorf("parse auth key: %w", err)
6061
}

0 commit comments

Comments
 (0)