public async Task <IActionResult> Create(User user) { if (ModelState.IsValid) { // Manual Auth is custom class to hold hash methods user.Password = ManualAuth.Sha256(user.Password); // Add user and save changes to database. _context.Add(user); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Welcome))); } return(View(user)); }
public async Task <IActionResult> Create(User user) { if (ModelState.IsValid) { // Hash the password user.Password = ManualAuth.Sha256(user.Password); // Now add. _context.Add(user); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Welcome))); } return(View(user)); }