ganahrhr 2 anos atrás
pai
commit
14fe2fbc96

+ 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();            
         }