Allow to change login

Upstream-commit: bb85ce9aff118bed4e53e8ef70df4f1ec1cb903b
Component: engine
This commit is contained in:
Guillaume J. Charmes
2013-05-15 13:39:24 -07:00
parent 6d65ac4800
commit d6276e6ddf
2 changed files with 6 additions and 3 deletions
+1 -3
View File
@@ -72,9 +72,7 @@ func postAuth(srv *Server, w http.ResponseWriter, r *http.Request, vars map[stri
if err != nil {
return err
} else {
// TODO: uncomment this
// srv.runtime.graph.getHttpClient().Jar = cookiejar.NewCookieJar()
srv.runtime.authConfig = newAuthConfig
srv.registry.ResetClient(newAuthConfig)
}
if status != "" {
b, err := json.Marshal(&ApiAuth{Status: status})
+5
View File
@@ -459,6 +459,11 @@ func (r *Registry) SearchRepositories(term string) (*SearchResults, error) {
return result, err
}
func (r *Registry) ResetClient(authConfig *auth.AuthConfig) {
r.authConfig = authConfig
r.client.Jar = cookiejar.NewCookieJar()
}
type SearchResults struct {
Query string `json:"query"`
NumResults int `json:"num_results"`