Problem Statement:
I want to customize the “The code you entered is invalid” message shown on the MFA page/prompt in the New Universal Login Experience.
Solution:
You can customize the texts shown in the New Universal Login Experience using the Auth0 Management API. For example, if you need to customize the “The code you entered is invalid” message shown on the Email MFA page, you can follow the steps given below.
- Obtain a Management API Access Token
- Identify which PROMPT and the SCREEN you need to customize. You can read more about available PROMPTs and SCREENs here. In your case, you need to customize the “mfa-email” prompt and the “mfa-email-challenge” screen.
- Send a PUT request to the https://<YOUR_DOMAIN>/api/v2/prompts//custom-text/;.
Here’s an example curl request.
curl --location --request PUT 'https://<YOUR_DOMAIN>/api/v2/prompts/mfa-email/custom-text/en'; \
--header 'Authorization: Bearer <AUTH0_MANAGEMENT_API_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"mfa-email-challenge": {
"invalid-code": "Please enter the correct code"
}
}'
Before:
After: