From a2bafb0dfc57f8a29358af7cf2e7d56c550d5629 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Thu, 30 Aug 2018 10:17:20 +0300 Subject: [PATCH] added SignInResult.GetResultAsString extension method --- .../Identity/AbpIdentityResultExtensions.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Microsoft/AspNetCore/Identity/AbpIdentityResultExtensions.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Microsoft/AspNetCore/Identity/AbpIdentityResultExtensions.cs index 298ae4fc01..58349e8b69 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Microsoft/AspNetCore/Identity/AbpIdentityResultExtensions.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Microsoft/AspNetCore/Identity/AbpIdentityResultExtensions.cs @@ -60,5 +60,30 @@ namespace Microsoft.AspNetCore.Identity return localizer["Identity.Default"]; } + + public static string GetResultAsString(this SignInResult signInResult) + { + if (signInResult.Succeeded) + { + return "Succeeded"; + } + + if (signInResult.IsLockedOut) + { + return "IsLockedOut"; + } + + if (signInResult.IsNotAllowed) + { + return "IsNotAllowed"; + } + + if (signInResult.RequiresTwoFactor) + { + return "RequiresTwoFactor"; + } + + return "Unknown"; + } } }