retrieveAuth0UserDetails retrieves required fields: email, and password for Auth0 strategy.
(cmd *cobra.Command, input *userInput)
| 478 | |
| 479 | // retrieveAuth0UserDetails retrieves required fields: email, and password for Auth0 strategy. |
| 480 | func retrieveAuth0UserDetails(cmd *cobra.Command, input *userInput) (*management.User, error) { |
| 481 | if err := userEmail.Ask(cmd, &input.email, nil); err != nil { |
| 482 | return nil, err |
| 483 | } |
| 484 | |
| 485 | if err := userPassword.AskPassword(cmd, &input.password); err != nil { |
| 486 | return nil, err |
| 487 | } |
| 488 | |
| 489 | userInfo := &management.User{ |
| 490 | Email: &input.email, |
| 491 | Password: &input.password, |
| 492 | Connection: &input.connectionName, |
| 493 | } |
| 494 | |
| 495 | // User's name is optional for auth0 connection and takes the email-id as default. |
| 496 | if input.name != "" { |
| 497 | userInfo.Name = &input.name |
| 498 | } |
| 499 | |
| 500 | return userInfo, nil |
| 501 | } |
| 502 | |
| 503 | // retrieveSMSUserDetails retrieves required fields: phone-number for sms strategy. |
| 504 | func retrieveSMSUserDetails(cmd *cobra.Command, input *userInput) (*management.User, error) { |
no test coverage detected