Hello @Felipe Vanegas ,
Thanks for posting you query on Microsoft Q&A. I was able to review this but as of now we don't have any ways to add customized error messages in user flow. Only available customization for user flows are customize-ui, Customize the user interface with HTML templates, Enable JavaScript and page layout. If this is the only possible way suiting your business needs the kindly post this request on our feedback portal which is monitored by our dev team.
Workaround:
However, we could customize the error message via custom policy by editing TrustFrameworkLocalization policy XML:
<Localization Enabled="true">
<SupportedLanguages DefaultLanguage="en" MergeBehavior="ReplaceAll">
<SupportedLanguage>en</SupportedLanguage>
</SupportedLanguages>
<LocalizedResources Id="api.signuporsignin.en">
<LocalizedStrings>
<LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfInvalidPassword">**The username and/or password you have entered is incorrect.**</LocalizedString>
<LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimsPrincipalDoesNotExist">**The username and/or password you have entered is incorrect.**</LocalizedString>
<LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfOldPasswordUsed">**The username and/or password you have entered is incorrect.**</LocalizedString>
</LocalizedStrings>
</LocalizedResources>
</Localization>
Please do let me know if you have any further queries.
Thanks,
Akshay Kaushik
Please "Accept the answer","Upvote" and rate your experience if the suggestion works as per your business need. This will help us and others in the community as well.