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

Function customizeUniversalLoginCmd

internal/cli/universal_login_customize.go:293–368  ·  view source on GitHub ↗
(cli *cli)

Source from the content-addressed store, hash-verified

291}
292
293func customizeUniversalLoginCmd(cli *cli) *cobra.Command {
294 var (
295 selectedRenderingMode string
296 input promptScreen
297 )
298
299 cmd := &cobra.Command{
300 Use: "customize",
301 Args: cobra.NoArgs,
302 Short: "⚠️ Customize Universal Login (Advanced mode DEPRECATED)",
303 Long: "\nCustomize your Universal Login Experience. Note that this requires a custom domain to be configured for the tenant.\n\n" +
304 "* Standard mode is recommended for creating a consistent, branded experience for users. Choosing Standard mode will open a webpage\n" +
305 " in your browser where you can edit and preview your branding changes. For a comprehensive list of editable parameters and their values,\n" +
306 " please visit the Management API documentation: https://auth0.com/docs/api/management/v2\n\n" +
307 "⚠️ DEPRECATION NOTICE: Advanced mode will be deprecated on " + sunsetDate + "\n" +
308 " For future Advanced Customizations, use: auth0 acul config <command>\n\n" +
309 "* Advanced mode is recommended for full customization and granular control of the login experience, allowing integration of your own component design system.\n" +
310 " Choosing Advanced mode will open the default terminal editor with rendering configurations in a settings.json file.\n\n" +
311 " Closing the terminal editor will save the settings to your tenant.",
312
313 Example: ` auth0 universal-login customize
314 auth0 ul customize`,
315 RunE: func(cmd *cobra.Command, args []string) error {
316 ctx := cmd.Context()
317
318 if err := ensureCustomDomainIsEnabled(ctx, cli.api); err != nil {
319 return err
320 }
321
322 if err := ensureNewUniversalLoginExperienceIsActive(ctx, cli.api); err != nil {
323 return err
324 }
325
326 if selectedRenderingMode == "" {
327 cli.renderer.Infof("Please select a rendering mode to customize:")
328 if err := renderingMode.Select(cmd, &selectedRenderingMode, []string{standardMode, advancedMode}, auth0.String(standardMode)); err != nil {
329 return err
330 }
331 }
332
333 if selectedRenderingMode == advancedMode {
334 if err := displayDeprecationStatus(cli, true); err != nil {
335 return err
336 }
337
338 // Add visual separation and brief pause to ensure users see the warning.
339 cli.renderer.Output(ansi.Bold("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"))
340 cli.renderer.Output("")
341
342 if !cli.noInput {
343 time.Sleep(1 * time.Second) // Brief pause to let users read.
344 }
345
346 err := fetchPromptScreenInfo(cmd, cli, &input, "customize")
347 if err != nil {
348 return err
349 }
350

Callers 1

universalLoginCmdFunction · 0.85

Calls 11

BoldFunction · 0.92
displayDeprecationStatusFunction · 0.85
fetchPromptScreenInfoFunction · 0.85
advanceCustomizeFunction · 0.85
startWebSocketServerFunction · 0.85
InfofMethod · 0.80
SelectMethod · 0.80
OutputMethod · 0.80
RegisterStringMethod · 0.80

Tested by

no test coverage detected