mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fixed some login quirks
This commit is contained in:
parent
594827d416
commit
18796d55a6
1 changed files with 6 additions and 2 deletions
|
@ -15,7 +15,7 @@ import (
|
|||
const CONFIGFILE = ".dockercfg"
|
||||
|
||||
// the registry server we want to login against
|
||||
const INDEX_SERVER = "http://indexstaging-docker.dotcloud.com"
|
||||
const INDEX_SERVER = "https://indexstaging-docker.dotcloud.com"
|
||||
|
||||
type AuthConfig struct {
|
||||
Username string `json:"username"`
|
||||
|
@ -123,8 +123,12 @@ func Login(authConfig *AuthConfig) (string, error) {
|
|||
}
|
||||
|
||||
if reqStatusCode == 201 {
|
||||
status = "Account Created\n"
|
||||
status = "Account created. Please use the confirmation link we sent"+
|
||||
" to your e-mail to activate it.\n"
|
||||
storeConfig = true
|
||||
} else if reqStatusCode == 403 {
|
||||
return "", fmt.Errorf("Login: Your account hasn't been activated. "+
|
||||
"Please check your e-mail for a confirmation link.")
|
||||
} else if reqStatusCode == 400 {
|
||||
if string(reqBody) == "\"Username or email already exists\"" {
|
||||
req, err := http.NewRequest("GET", INDEX_SERVER+"/v1/users/", nil)
|
||||
|
|
Loading…
Add table
Reference in a new issue