Просмотр исходного кода

set project from token successful login

Alexander Belanger 4 лет назад
Родитель
Сommit
5eabced381
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      cli/cmd/auth.go

+ 8 - 0
cli/cmd/auth.go

@@ -84,6 +84,14 @@ func login() error {
 			// set the token if the user calls login with the --token flag
 			config.SetToken(config.Token)
 			color.New(color.FgGreen).Println("Successfully logged in!")
+
+			projID, err := api.GetProjectIDFromToken(token)
+
+			if err != nil {
+				return err
+			}
+
+			config.SetProject(projID)
 		} else {
 			color.Yellow("You are already logged in. If you'd like to log out, run \"porter auth logout\".")
 		}