diff --git a/internal/cli/prompts_custom_text.go b/internal/cli/prompts_custom_text.go index 6f30a368d..bdb82e46e 100644 --- a/internal/cli/prompts_custom_text.go +++ b/internal/cli/prompts_custom_text.go @@ -217,9 +217,12 @@ func downloadDefaultBrandingTextTranslations(prompt, language string) map[string return nil } - selectedPrompt := allPrompts[0][prompt].(map[string]interface{}) - - return selectedPrompt + for _, value := range allPrompts { + _, ok := value[prompt] + if ok { + return value[prompt].(map[string]interface{}) + } + } } return nil diff --git a/test/integration/fixtures/update-ul-prompts-login.json b/test/integration/fixtures/update-ul-prompts-login.json new file mode 100644 index 000000000..473b4e0c5 --- /dev/null +++ b/test/integration/fixtures/update-ul-prompts-login.json @@ -0,0 +1,40 @@ +{ + "login": { + "pageTitle": "Log in | ${clientName}", + "title": "Welcome", + "description": "Log in to ${companyName} to continue to ${clientName}.", + "separatorText": "Or", + "buttonText": "Continue", + "federatedConnectionButtonText": "Continue with ${connectionName}", + "footerLinkText": "Sign up", + "signupActionLinkText": "${footerLinkText}", + "footerText": "Don't have an account?", + "signupActionText": "${footerText}", + "forgotPasswordText": "Forgot password?", + "passwordPlaceholder": "Password", + "usernamePlaceholder": "Username or email address", + "emailPlaceholder": "Email address", + "editEmailText": "Edit", + "alertListTitle": "Alerts", + "invitationTitle": "You've Been Invited!", + "invitationDescription": "Log in to accept ${inviterName}'s invitation to join ${companyName} on ${clientName}.", + "logoAltText": "${companyName}", + "showPasswordText": "Show password", + "hidePasswordText": "Hide password", + "wrong-credentials": "Wrong username or password", + "invalid-email-format": "Email is not valid.", + "wrong-email-credentials": "Wrong email or password", + "custom-script-error-code": "Something went wrong, please try again later.", + "auth0-users-validation": "Something went wrong, please try again later", + "authentication-failure": "We are sorry, something went wrong when attempting to login", + "invalid-connection": "Invalid connection", + "ip-blocked": "We have detected suspicious login behavior and further attempts will be blocked. Please contact the administrator.", + "no-db-connection": "Invalid connection", + "password-breached": "We have detected a potential security issue with this account. To protect your account, we have prevented this login. Please reset your password to proceed.", + "user-blocked": "Your account has been blocked after multiple consecutive login attempts.", + "same-user-login": "Too many login attempts for this user. Please wait, and try again later.", + "no-email": "Please enter an email address", + "no-password": "Password is required", + "no-username": "Username is required" + } +} diff --git a/test/integration/fixtures/update-ul-prompts-mfa-push.json b/test/integration/fixtures/update-ul-prompts-mfa-push.json new file mode 100644 index 000000000..7f5a77af9 --- /dev/null +++ b/test/integration/fixtures/update-ul-prompts-mfa-push.json @@ -0,0 +1,64 @@ +{ + "mfa-push-welcome": { + "pageTitle": "Install the application | ${clientName}", + "title": "Secure Your Account", + "description": "In order to continue, install the ${appName} app via the app store from your mobile device.", + "androidButtonText": "Google Play", + "buttonText": "Continue", + "iosButtonText": "App Store", + "pickAuthenticatorText": "Try another method", + "logoAltText": "${companyName}" + }, + "mfa-push-enrollment-qr": { + "pageTitle": "Scan the code to log in using a push notification | ${clientName}", + "title": "Secure Your Account", + "description": "Scan the QR Code below using the ${appName} app on your mobile device.", + "pickAuthenticatorText": "Try another method", + "buttonText": "Continue", + "logoAltText": "${companyName}", + "enrollment-transaction-pending": "You must scan the QR code with the ${appName} app on your mobile device." + }, + "mfa-push-enrollment-code": { + "pageTitle": "Copy the code to log in using a push notification | ${clientName}", + "buttonText": "Continue", + "altText": "Secure code to copy", + "copyCodeButtonText": "Copy Code", + "instructions1": "Open the ${appName} app on your phone and tap \"+\" button.", + "instructions2": "Select Add account manually", + "instructions3": "Copy & paste this code to that screen", + "title": "Trouble scanning?", + "logoAltText": "${companyName}" + }, + "mfa-push-success": { + "pageTitle": "Device registration successful | ${clientName}", + "title": "You're All Set!", + "buttonText": "Continue", + "description": "We’re redirecting you to ${clientName} now. If you’re not redirected automatically, you can manually redirect yourself below." + }, + "mfa-push-challenge-push": { + "pageTitle": "Accept the push notification to log in | ${clientName}", + "title": "Verify Your Identity", + "description": "We’ve sent a notification to the following device via the ${appName} app:", + "buttonText": "I've responded on my device", + "pickAuthenticatorText": "Try another method", + "rememberMeText": "Remember this device for 30 days", + "resendActionText": "Resend", + "resendText": "Didn't receive a notification?", + "enterOtpCode": "Manually Enter Code", + "separatorText": "OR", + "logoAltText": "${companyName}", + "challenge-transaction-pending": "You must accept the notification via the ${appName} app on your mobile device.", + "polling-interval-exceeded": "We have not received a confirmation, please slow down.", + "too-many-push": "We have received too many notification requests. Wait a few minutes and try again.", + "transaction-not-found": "Your enrollment transaction expired, you will need to start again.", + "mfa-push-verify-transaction-pending": "We have not received a confirmation, please try scanning the code again.", + "mfa-push-verify-authenticator-error": "We couldn't verify the enrollment. Please try again later.", + "mfa-push-challenge-authenticator-error": "We couldn't send the notification. Please try again later.", + "transaction-rejected": "Notification rejected" + }, + "mfa-push-list": { + "pageTitle": "List of available devices | ${clientName}", + "backText": "Go back", + "title": "Registered Devices" + } +} diff --git a/test/integration/test-cases.yaml b/test/integration/test-cases.yaml index 255573f57..9d2d003ac 100644 --- a/test/integration/test-cases.yaml +++ b/test/integration/test-cases.yaml @@ -710,3 +710,11 @@ tests: display_name: "Integration Test Updated Organization" branding.colors.page_background: "#AA1166" branding.colors.primary: "#00FFAA" + + update universal login branding prompts (login): + command: cat ./test/integration/fixtures/update-ul-prompts-login.json | auth0 ul prompts update login + exit-code: 0 + + update universal login branding prompts (mfa-push): + command: cat ./test/integration/fixtures/update-ul-prompts-mfa-push.json | auth0 ul prompts update mfa-push + exit-code: 0