chatr/ChatrServer/Chatr/AuthenticationResult.cs

44 lines
1.0 KiB
C#

namespace Tesses.Chatr.Server
{
public class AuthenticationResult
{
public AuthenticationResult(string error)
{
Success=UserManagement.AllowLoginAsAnnonymous;
Account = UserManagement.GetAnonymous();
Session=new Session() {RememberMe=true,SessionId=""};
NotAnonymous=false;
}
public AuthenticationResult(Account account,Session session)
{
Success=true;
Account =account;
Session=session;
NotAnonymous=true;
}
public bool NotAnonymous {get;set;}
public bool Success {get;set;}
public string Error {get;set;}
public Account Account {get;set;}
public Session Session {get;set;}
}
public class AuthenticationBotResult
{
public AuthenticationBotResult(Bot bot)
{
Bot=bot;
Success=true;
}
public AuthenticationBotResult(string error)
{
Success=false;
Error=error;
}
public bool Success {get;set;}
public string Error {get;set;}
public Bot Bot {get;set;}
}
}