mirror of
https://github.com/bitwarden/server
synced 2026-01-06 02:23:51 +00:00
initial commit of source
This commit is contained in:
34
src/Core/Identity/JwtBearerSignInResult.cs
Normal file
34
src/Core/Identity/JwtBearerSignInResult.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Bit.Core.Domains;
|
||||
|
||||
namespace Bit.Core.Identity
|
||||
{
|
||||
public class JwtBearerSignInResult
|
||||
{
|
||||
private static readonly JwtBearerSignInResult _success = new JwtBearerSignInResult { Succeeded = true };
|
||||
private static readonly JwtBearerSignInResult _failed = new JwtBearerSignInResult();
|
||||
private static readonly JwtBearerSignInResult _lockedOut = new JwtBearerSignInResult { IsLockedOut = true };
|
||||
private static readonly JwtBearerSignInResult _notAllowed = new JwtBearerSignInResult { IsNotAllowed = true };
|
||||
private static readonly JwtBearerSignInResult _twoFactorRequired = new JwtBearerSignInResult { RequiresTwoFactor = true };
|
||||
|
||||
public bool Succeeded { get; protected set; }
|
||||
public bool IsLockedOut { get; protected set; }
|
||||
public bool IsNotAllowed { get; protected set; }
|
||||
public bool RequiresTwoFactor { get; protected set; }
|
||||
public string Token { get; set; }
|
||||
public User User { get; set; }
|
||||
|
||||
public static JwtBearerSignInResult Success => _success;
|
||||
public static JwtBearerSignInResult Failed => _failed;
|
||||
public static JwtBearerSignInResult LockedOut => _lockedOut;
|
||||
public static JwtBearerSignInResult NotAllowed => _notAllowed;
|
||||
public static JwtBearerSignInResult TwoFactorRequired => _twoFactorRequired;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return IsLockedOut ? "Lockedout" :
|
||||
IsNotAllowed ? "NotAllowed" :
|
||||
RequiresTwoFactor ? "RequiresTwoFactor" :
|
||||
Succeeded ? "Succeeded" : "Failed";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user