1
0
mirror of https://github.com/docker/cli.git synced 2026-01-18 08:21:31 +03:00

fix login

Upstream-commit: 24c785bc062c19488a47d9ed9ed2799a3c6783f8
Component: engine
This commit is contained in:
Victor Vieux
2013-05-08 23:57:14 +02:00
parent c812fb432f
commit 85cd179914
2 changed files with 3 additions and 3 deletions

View File

@@ -53,7 +53,6 @@ func getAuth(srv *Server, w http.ResponseWriter, r *http.Request) ([]byte, error
func postAuth(srv *Server, w http.ResponseWriter, r *http.Request) ([]byte, error) {
var config auth.AuthConfig
if err := json.NewDecoder(r.Body).Decode(&config); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return nil, err
}
@@ -73,8 +72,8 @@ func postAuth(srv *Server, w http.ResponseWriter, r *http.Request) ([]byte, erro
b, err := json.Marshal(ApiAuth{status})
if err != nil {
return nil, err
return b, nil
}
return b, nil
}
w.WriteHeader(http.StatusOK)
return nil, nil

View File

@@ -270,11 +270,12 @@ func CmdLogin(args ...string) error {
}
var out2 ApiAuth
err = json.Unmarshal(body, &out)
err = json.Unmarshal(body, &out2)
if err != nil {
return err
}
if out2.Status != "" {
RestoreTerminal(oldState)
fmt.Print(out2.Status)
}
return nil