(cli *cli)
| 291 | } |
| 292 | |
| 293 | func 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 |
no test coverage detected