Allow to change login
This commit is contained in:
parent
dc9d6c1c1f
commit
bb85ce9aff
4
api.go
4
api.go
|
@ -72,9 +72,7 @@ func postAuth(srv *Server, w http.ResponseWriter, r *http.Request, vars map[stri
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
} else {
|
} else {
|
||||||
// TODO: uncomment this
|
srv.registry.ResetClient(newAuthConfig)
|
||||||
// srv.runtime.graph.getHttpClient().Jar = cookiejar.NewCookieJar()
|
|
||||||
srv.runtime.authConfig = newAuthConfig
|
|
||||||
}
|
}
|
||||||
if status != "" {
|
if status != "" {
|
||||||
b, err := json.Marshal(&ApiAuth{Status: status})
|
b, err := json.Marshal(&ApiAuth{Status: status})
|
||||||
|
|
|
@ -459,6 +459,11 @@ func (r *Registry) SearchRepositories(term string) (*SearchResults, error) {
|
||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *Registry) ResetClient(authConfig *auth.AuthConfig) {
|
||||||
|
r.authConfig = authConfig
|
||||||
|
r.client.Jar = cookiejar.NewCookieJar()
|
||||||
|
}
|
||||||
|
|
||||||
type SearchResults struct {
|
type SearchResults struct {
|
||||||
Query string `json:"query"`
|
Query string `json:"query"`
|
||||||
NumResults int `json:"num_results"`
|
NumResults int `json:"num_results"`
|
||||||
|
|
Loading…
Reference in New Issue