Open Closed

password error messages #8664


User avatar
0
LiSong created
  • ABP Framework version: v9.0.0
  • UI Type: MVC
  • Database System: SQL Server
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

I want to make each rule on it's own line so it's clearer to read, Then each can end with a '.' to get ride of the '.,' issue, how can I make the changes?

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

5 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    It seems like a problem, I will check it.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    LiSong created

    thanks, any updates?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    HI, you can override the page alerts page

    Create a Default.cshtml file under the Themes/LeptonX/Components/Common/PageAlerts folder in the authserver project.

    @model Volo.Abp.AspNetCore.Mvc.UI.Alerts.AlertList
    @if (Model.Any())
    {
        <div id="AbpPageAlerts">
            @foreach (var alertMessage in Model)
            {
                alertMessage.Text = alertMessage.Text.Replace(".,", "."+Environment.NewLine);
                <abp-alert alert-type="@(alertMessage.Type)" style="white-space: pre-line" dismissible="@alertMessage.Dismissible">@if (alertMessage.Title != null) { <h4>@alertMessage.Title</h4> }@alertMessage.Text</abp-alert>
            }
        </div>
    }
    

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    LiSong created

    is there a way to customize the error messages? for example we show 4 error messages here for pwd, but is there a way to combine them into one? like here it shows one message for each rule, I want to combine them and shows passwords must be at least 6 characters and must have at least...

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    Yes, but the localized text is independent: https://github.com/abpframework/abp/blob/docspatch/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json#L54-L59

    You can override the Register model.

    [Dependency(ReplaceServices = true)]
    [ExposeServices(typeof(RegisterModel))]
    public class MyRegisterModel : RegisterModel
    {
        protected override string GetLocalizeExceptionMessage(Exception exception)
        {
            var message = base.GetLocalizeExceptionMessage(exception);
            if(message.Contains("Passwords must"))
            {
                message = // change message here
            }
            return message;
        }
    }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.