Skip to content

Commit

Permalink
Merge pull request #592 from SavageLearning/feature/solve-issues-affe…
Browse files Browse the repository at this point in the history
…cting-daily-work

solves #422, related to #446, fixes previous commit and solves #583
  • Loading branch information
chaim1221 authored Mar 8, 2020
2 parents 25478bb + c7210c2 commit 1315432
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Machete.Web/Controllers/Api/EmployersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ public ActionResult ProfilePut([FromBody]EmployerViewModel viewmodel)
newEmployer = true;
}
employer.onlineSigninID = UserSubject;
employer.email = UserEmail;
map.Map<EmployerViewModel, Domain.Employer>(viewmodel, employer);
employer.email = UserEmail;

Domain.Employer result;
if (newEmployer)
Expand Down
7 changes: 4 additions & 3 deletions Machete.Web/Controllers/Legacy/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,13 @@ public async Task<ActionResult> Edit([Bind]EditUserViewModel model)
{
var user = _context.Users.First(u => u.Id == model.Id);
var macheteUserName = model.FirstName.Trim() + "." + model.LastName.Trim();
var dupeUser = await _userManager.FindByEmailAsync(model.Email);
user.UserName = macheteUserName;
user.LoweredUserName = macheteUserName.ToLower();
if (dupeUser != null && dupeUser.Email == model.Email)
//Check for duplicate emails, if any, show error message
var dupeUserCount = _context.Users.Count(u => u.Email == model.Email && u.Id != model.Id);
if (dupeUserCount > 0)
{
ModelState.AddModelError("ErrorMessage", ValidationStrings.dupeEmail);
ModelState.AddModelError("", ValidationStrings.dupeEmail);
return View(model);
}
user.Email = model.Email.Trim();
Expand Down
8 changes: 4 additions & 4 deletions Machete.Web/StartupConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ public static void ConfigureAuthentication(this IServiceCollection services, ICo
services.Configure<IdentityOptions>(options =>
{
// Password settings; we are relying on validation
options.Password.RequireDigit = false;
options.Password.RequiredLength = 6;
options.Password.RequireDigit = true;
options.Password.RequiredLength = 8;
options.Password.RequireNonAlphanumeric = false;
options.Password.RequireUppercase = false;
options.Password.RequireUppercase = true;
options.Password.RequireLowercase = false;
options.Password.RequiredUniqueChars = 0;
options.Password.RequiredUniqueChars = 6;

// Lockout settings
options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromMinutes(30);
Expand Down

0 comments on commit 1315432

Please sign in to comment.