ganahrhr 2 éve
szülő
commit
14fe2fbc96
1 módosított fájl, 6 hozzáadás és 4 törlés
  1. 6 4
      Areas/Identity/Pages/Account/ConfirmEmail.cshtml.cs

+ 6 - 4
Areas/Identity/Pages/Account/ConfirmEmail.cshtml.cs

@@ -42,10 +42,12 @@ namespace HyperCube.Areas.Identity.Pages.Account
             var result = await _userManager.ConfirmEmailAsync(user, code);
             StatusMessage = result.Succeeded ? "Thank you for confirming your email." : "Error confirming your email.";
 
-            Console.WriteLine($"Adding new user [{user.UserName}], id: [{userId}] to list!");
-            ///adding new confirmed user
-            Models.AccountModel newAcc = new();
-            Models.AccountModel.Loaded.Add(userId, newAcc);
+            if (result.Succeeded)
+            {
+                Console.WriteLine($"Adding new confirmed user [{user.UserName}], id: [{userId}] to list!");
+                Models.AccountModel newAcc = new();
+                Models.AccountModel.Loaded.Add(userId, newAcc);
+            }
 
             return Page();            
         }