()
| 40 | } |
| 41 | |
| 42 | func newAuthLoginCmd() *cobra.Command { |
| 43 | var forceHeadlessLogin bool |
| 44 | cmd := &cobra.Command{ |
| 45 | Use: "login", |
| 46 | Short: "authenticate the CLI with the Control Plane", |
| 47 | RunE: func(cmd *cobra.Command, args []string) error { |
| 48 | return interactiveAuth(forceHeadlessLogin) |
| 49 | }, |
| 50 | } |
| 51 | |
| 52 | cmd.Flags().BoolVar(&forceHeadlessLogin, "skip-browser", false, "perform a headless login process without opening a browser") |
| 53 | return cmd |
| 54 | } |
| 55 | |
| 56 | func interactiveAuth(forceHeadless bool) error { |
| 57 | var a app |
no test coverage detected