From ad590f6011100c78664edd6431983d325ffb7eac Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Thu, 1 Aug 2024 10:05:46 +0500 Subject: [PATCH] identity: auto enable 2fa by email on self hosted instance --- Streetwriters.Identity/Controllers/SignupController.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Streetwriters.Identity/Controllers/SignupController.cs b/Streetwriters.Identity/Controllers/SignupController.cs index 6cbc7e6..dee3392 100644 --- a/Streetwriters.Identity/Controllers/SignupController.cs +++ b/Streetwriters.Identity/Controllers/SignupController.cs @@ -26,6 +26,7 @@ You should have received a copy of the Affero GNU General Public License using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Streetwriters.Common; +using Streetwriters.Common.Enums; using Streetwriters.Common.Models; using Streetwriters.Identity.Enums; using Streetwriters.Identity.Interfaces; @@ -105,6 +106,7 @@ public async Task Signup([FromForm] SignupForm form) if (Constants.IS_SELF_HOSTED) { await UserManager.AddClaimAsync(user, UserService.SubscriptionTypeToClaim(client.Id, Common.Enums.SubscriptionType.PREMIUM)); + await MFAService.EnableMFAAsync(user, MFAMethods.Email); } else {