8000 fix: using a trailing slash on login url (#1622) · coder/coder@c189fc5 · GitHub
[go: up one dir, main page]

Skip to content

Commit c189fc5

Browse files
authored
fix: using a trailing slash on login url (#1622)
1 parent ce7bf0b commit c189fc5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cli/login.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"os"
99
"os/exec"
1010
"os/user"
11+
"path"
1112
"runtime"
1213
"strings"
1314

@@ -171,7 +172,9 @@ func login() *cobra.Command {
171172
sessionToken, _ := cmd.Flags().GetString(varToken)
172173
if sessionToken == "" {
173174
authURL := *serverURL
174-
authURL.Path = serverURL.Path + "/cli-auth"
175+
// Don't use filepath.Join, we don't want to use the os separator
176+
// for a url.
177+
authURL.Path = path.Join(serverURL.Path, "/cli-auth")
175178
if err := openURL(cmd, authURL.String()); err != nil {
176179
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "Open the following in your browser:\n\n\t%s\n\n", authURL.String())
177180
} else {

0 commit comments

Comments
 (0)
0