public static void CoreOnDerive(this User @this, ObjectOnDerive method) { @this.DerivedRoles.NormalizedUserName = Users.Normalize(@this.UserName); @this.DerivedRoles.NormalizedUserEmail = Users.Normalize(@this.UserEmail); if (@this.ExistInUserPassword) { var passwordService = @this.Session().ServiceProvider.GetRequiredService <IPasswordService>(); @this.UserPasswordHash = passwordService.HashPassword(@this.UserName, @this.InUserPassword); @this.RemoveInUserPassword(); } }
public User GetUser(string userName) => this.FindBy(this.Meta.NormalizedUserName, Users.Normalize(userName)) ?? new AutomatedAgents(this.Session).Guest;