Fix the rootPath for auth
Upstream-commit: e726bdcce2606acef136a4d5ba47e367d9e461df Component: engine
This commit is contained in:
@ -25,6 +25,15 @@ type AuthConfig struct {
|
||||
rootPath string `json:-`
|
||||
}
|
||||
|
||||
func NewAuthConfig(username, password, email, rootPath string) *AuthConfig {
|
||||
return &AuthConfig{
|
||||
Username: username,
|
||||
Password: password,
|
||||
Email: email,
|
||||
rootPath: rootPath,
|
||||
}
|
||||
}
|
||||
|
||||
// create a base64 encoded auth string to store in config
|
||||
func EncodeAuth(authConfig *AuthConfig) string {
|
||||
authStr := authConfig.Username + ":" + authConfig.Password
|
||||
|
||||
@ -94,7 +94,7 @@ func (srv *Server) CmdLogin(stdin io.ReadCloser, stdout io.Writer, args ...strin
|
||||
password = srv.runtime.authConfig.Password
|
||||
email = srv.runtime.authConfig.Email
|
||||
}
|
||||
newAuthConfig := &auth.AuthConfig{Username: username, Password: password, Email: email}
|
||||
newAuthConfig := auth.NewAuthConfig(username, password, email, srv.runtime.root)
|
||||
status, err := auth.Login(newAuthConfig)
|
||||
if err != nil {
|
||||
fmt.Fprintf(stdout, "Error : %s\n", err)
|
||||
|
||||
Reference in New Issue
Block a user