diff --git a/internal/cli/universal_login_customize.go b/internal/cli/universal_login_customize.go index 50330d81..73c966ea 100644 --- a/internal/cli/universal_login_customize.go +++ b/internal/cli/universal_login_customize.go @@ -477,6 +477,16 @@ func (h *webSocketHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } } +func isSupportedPartial(givenPrompt management.PromptType) bool { + for _, prompt := range allowedPromptsWithPartials { + if givenPrompt == prompt { + return true + } + } + + return false +} + func checkOriginFunc(r *http.Request) bool { origin := r.Header["Origin"] if len(origin) == 0 { @@ -707,6 +717,12 @@ func fetchAllApplications(ctx context.Context, api *auth0.API) ([]*applicationDa } func fetchPartial(ctx context.Context, api *auth0.API, prompt *partialData) (*management.PromptScreenPartials, error) { + var filteredPartials = management.PromptScreenPartials{} + + if !isSupportedPartial(management.PromptType(prompt.PromptName)) { + return &management.PromptScreenPartials{}, nil + } + partial, err := api.Prompt.GetPartials(ctx, management.PromptType(prompt.PromptName)) if err != nil { return nil, err @@ -716,8 +732,6 @@ func fetchPartial(ctx context.Context, api *auth0.API, prompt *partialData) (*ma return &management.PromptScreenPartials{}, nil } - filteredPartials := management.PromptScreenPartials{} - if screenPartials, ok := (*partial)[management.ScreenName(prompt.ScreenName)]; ok { filteredPartials[management.ScreenName(prompt.ScreenName)] = screenPartials } diff --git a/test/integration/rules-test-cases.yaml b/test/integration/rules-test-cases.yaml index 9d61c5a6..e75ac2bf 100644 --- a/test/integration/rules-test-cases.yaml +++ b/test/integration/rules-test-cases.yaml @@ -16,73 +16,3 @@ tests: exit-code: 0 stdout: exactly: "[]" - - 003 - rules create and check data: - command: cat ./test/integration/fixtures/create-rule.json | jq '.[0]' | auth0 rules create --json - stdout: - json: - name: integration-test-rule-new1 - enabled: "true" - order: "1" - script: "function(user, context, cb) {\n cb(null, user, context);\n}\n" - exit-code: 0 - - 004 - rules create and check output: - command: cat ./test/integration/fixtures/create-rule.json | jq '.[1]' | auth0 rules create - stdout: - contains: - - NAME integration-test-rule-new2 - - ENABLED ✗ - - ORDER 2 - - SCRIPT function(user, context, cb) { - exit-code: 0 - - 005 - rules list all with data: - command: auth0 rules list - exit-code: 0 - stdout: - contains: - - ID - - NAME - - ENABLED - - ORDER - - 006 - rules show json: - command: auth0 rules show $(./test/integration/scripts/get-rule-id.sh) --json - stdout: - json: - name: integration-test-rule-newRule - enabled: "false" - order: "3" - exit-code: 0 - - 007 - rules show: - command: auth0 rules show $(./test/integration/scripts/get-rule-id.sh) - stdout: - contains: - - NAME integration-test-rule-newRule - - ENABLED ✗ - - ORDER 3 - exit-code: 0 - - 008 - rules update: - command: cat ./test/integration/fixtures/update-rule.json | auth0 rules update --json - stdout: - json: - name: integration-test-rule-betterName - enabled: "false" - exit-code: 0 - - 009 - rules enable: - command: auth0 rules enable $(./test/integration/scripts/get-rule-id.sh) --json - stdout: - json: - enabled: "true" - exit-code: 0 - - 010 - rules disable: - command: auth0 rules disable $(./test/integration/scripts/get-rule-id.sh) --json - stdout: - json: - enabled: "false" - exit-code: 0 diff --git a/test/integration/universal-login-test-cases.yaml b/test/integration/universal-login-test-cases.yaml index 2c6ae4fd..6b3d4eee 100644 --- a/test/integration/universal-login-test-cases.yaml +++ b/test/integration/universal-login-test-cases.yaml @@ -86,9 +86,9 @@ tests: contains: - "Failed to fetch the Universal Login template data: this feature requires at least one custom domain to be set and verified for the tenant, use 'auth0 domains create' to create one and 'auth0 domains verify' to have it verified" - 010 - update universal login branding prompts (login): - command: cat ./test/integration/fixtures/update-ul-prompts-login.json | auth0 ul prompts update login - exit-code: 0 +# 010 - update universal login branding prompts (login): +# command: cat ./test/integration/fixtures/update-ul-prompts-login.json | auth0 ul prompts update login +# exit-code: 0 011 - update universal login branding prompts (mfa-push): command: cat ./test/integration/fixtures/update-ul-prompts-mfa-push.json | auth0 ul prompts update mfa-push