Skip to content

Commit

Permalink
remvoe unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
jlarfors committed Mar 12, 2024
1 parent 19e72dd commit b981ce8
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions pkg/hzctl/login/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"io"
"log"
"net"
"net/http"
Expand Down Expand Up @@ -102,39 +101,6 @@ func (l *loginHandler) handleLogin(w http.ResponseWriter, r *http.Request) {
).Render(r.Context(), w)
}

func postNewUser(
baseURL *url.URL,
cookie *http.Cookie,
) ([]byte, error) {
loginURL := baseURL.JoinPath("auth", "login")
req, err := http.NewRequest(
"POST",
loginURL.String(),
nil,
)
if err != nil {
return nil, fmt.Errorf("new request: %w", err)
}
req.AddCookie(cookie)

resp, err := http.DefaultClient.Do(req)
if err != nil {
return nil, fmt.Errorf("do request: %w", err)
}
defer resp.Body.Close()

if err := hz.ErrorFromHTTP(resp); err != nil {
return nil, err
}

userConfig, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("read response: %w", err)
}

return userConfig, nil
}

func openBrowser(url string) error {
var cmd *exec.Cmd
switch runtime.GOOS {
Expand Down

0 comments on commit b981ce8

Please sign in to comment.