| 243 | } |
| 244 | |
| 245 | func (p *accessiblePrompter) AuthToken() (string, error) { |
| 246 | var result string |
| 247 | // EchoModeNone and EchoModePassword both result in disabling echo mode |
| 248 | // as password masking is outside of VT100 spec. |
| 249 | form := p.newForm( |
| 250 | huh.NewGroup( |
| 251 | huh.NewInput(). |
| 252 | EchoMode(huh.EchoModeNone). |
| 253 | Title("Paste your authentication token:"). |
| 254 | // Note: if this validation fails, the prompt loops. |
| 255 | Validate(func(input string) error { |
| 256 | if input == "" { |
| 257 | return fmt.Errorf("token is required") |
| 258 | } |
| 259 | return nil |
| 260 | }). |
| 261 | Value(&result), |
| 262 | ), |
| 263 | ) |
| 264 | |
| 265 | err := form.Run() |
| 266 | return result, err |
| 267 | } |
| 268 | |
| 269 | func (p *accessiblePrompter) ConfirmDeletion(requiredValue string) error { |
| 270 | form := p.newForm( |