logout subcommand
()
| 103 | return writeOK(map[string]string{"method": "oauth"}, output.WithSummary("Logged in successfully")) |
| 104 | }, |
| 105 | } |
| 106 | |
| 107 | cmd.Flags().StringVar(&token, "token", "", "Pre-generated Bearer token") |
| 108 | cmd.Flags().StringVar(&cookie, "cookie", "", "Session cookie value from browser (session_token)") |
| 109 | cmd.Flags().BoolVar(&noBrowser, "no-browser", false, "Don't open browser, print URL instead") |
| 110 | |
| 111 | return cmd |
| 112 | } |
| 113 | |
| 114 | // logout subcommand |
| 115 | |
| 116 | func newAuthLogoutCommand() *cobra.Command { |
| 117 | return buildLogoutCommand("hey auth logout") |
| 118 | } |
| 119 | |
| 120 | // buildLogoutCommand constructs a logout command whose example reads as the |
| 121 | // given path. Shared by `hey auth logout` and the top-level `hey logout`. |
| 122 | func buildLogoutCommand(path string) *cobra.Command { |
| 123 | return &cobra.Command{ |
no test coverage detected