urlPromptFor creates the correct prompt based on app type for asking the user if they would like to add default urls.
(qsType string, qsStack string)
| 330 | // urlPromptFor creates the correct prompt based on app type for |
| 331 | // asking the user if they would like to add default urls. |
| 332 | func urlPromptFor(qsType string, qsStack string) string { |
| 333 | var p strings.Builder |
| 334 | p.WriteString("Quickstarts use localhost, do you want to add %s to the list\n of allowed callback URLs") |
| 335 | switch strings.ToLower(qsStack) { |
| 336 | case "next.js": // See https://github.com/auth0/auth0-cli/issues/200 |
| 337 | p.WriteString(" and %s to the list of allowed logout URLs?") |
| 338 | return fmt.Sprintf(p.String(), defaultCallbackURLFor(qsStack), defaultURLFor(qsStack)) |
| 339 | default: |
| 340 | if strings.EqualFold(qsType, qsSpa) { |
| 341 | p.WriteString(", logout URLs, origins and web origins?") |
| 342 | } else { |
| 343 | p.WriteString(" and logout URLs?") |
| 344 | } |
| 345 | } |
| 346 | return fmt.Sprintf(p.String(), defaultURLFor(qsStack)) |
| 347 | } |
| 348 | |
| 349 | func defaultURLFor(s string) string { |
| 350 | switch strings.ToLower(s) { |
no test coverage detected