public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } string pw = Gebruiker.PASSWORD; var hashed = PasswordStorage.HashPassword(Encoding.UTF8.GetBytes(pw), PasswordStorage.GenerateSalt(), 50000); pw = Convert.ToBase64String(hashed); Gebruiker.PASSWORD = pw; _context.Users.Add(Gebruiker); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }