This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create a class that inherits IdentityErrorDescriber | |
using Microsoft.AspNetCore.Identity; | |
public class ItalianIdentityErrorDescriber : IdentityErrorDescriber | |
{ | |
public override IdentityError PasswordRequiresUniqueChars(int uniqueChars) => new IdentityError { Code = nameof(PasswordRequiresUniqueChars), Description = $"La password deve essere contenere almeno {uniqueChars} caratteri univoci." }; | |
public override IdentityError RecoveryCodeRedemptionFailed() => new IdentityError { Code = nameof(RecoveryCodeRedemptionFailed), Description = $"Il codice di recupero non è stato utilizzato correttamente." }; | |
public override IdentityError UserNotInRole(string role) => new IdentityError() { Code = nameof(UserNotInRole), Description = $"l'utente non fa parte del ruolo {role}." }; | |
public override IdentityError DefaultError() => new IdentityError { Code = nameof(DefaultError), Description = $"Si è verificato un errore sconosciuto." }; |