Browse Source

added SignInResult.GetResultAsString extension method

pull/7950/head
Halil ibrahim Kalkan 8 years ago
parent
commit
a2bafb0dfc
  1. 25
      modules/identity/src/Volo.Abp.Identity.Domain/Microsoft/AspNetCore/Identity/AbpIdentityResultExtensions.cs

25
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";
}
}
}

Loading…
Cancel
Save