Fixed some login quirks
This commit is contained in:
parent
594827d416
commit
18796d55a6
|
@ -15,7 +15,7 @@ import (
|
||||||
const CONFIGFILE = ".dockercfg"
|
const CONFIGFILE = ".dockercfg"
|
||||||
|
|
||||||
// the registry server we want to login against
|
// 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 {
|
type AuthConfig struct {
|
||||||
Username string `json:"username"`
|
Username string `json:"username"`
|
||||||
|
@ -123,8 +123,12 @@ func Login(authConfig *AuthConfig) (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if reqStatusCode == 201 {
|
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
|
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 {
|
} else if reqStatusCode == 400 {
|
||||||
if string(reqBody) == "\"Username or email already exists\"" {
|
if string(reqBody) == "\"Username or email already exists\"" {
|
||||||
req, err := http.NewRequest("GET", INDEX_SERVER+"/v1/users/", nil)
|
req, err := http.NewRequest("GET", INDEX_SERVER+"/v1/users/", nil)
|
||||||
|
|
Loading…
Reference in New Issue