MCPcopy Create free account
hub / github.com/auth0/auth0-cli / urlPromptFor

Function urlPromptFor

internal/cli/quickstarts.go:332–347  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

330// urlPromptFor creates the correct prompt based on app type for
331// asking the user if they would like to add default urls.
332func 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
349func defaultURLFor(s string) string {
350 switch strings.ToLower(s) {

Callers 1

promptDefaultURLsFunction · 0.85

Calls 2

defaultCallbackURLForFunction · 0.85
defaultURLForFunction · 0.85

Tested by

no test coverage detected