You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1014 B
34 lines
1014 B
using Models;
|
|
using Endpoint;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace LocalEndpoint
|
|
{
|
|
internal class ConnectionManager : IAccountManager
|
|
{
|
|
private Account userAccount = Constants.MAIN_USER_ACCOUNT;
|
|
private string userPassword = Constants.MAIN_USER_PASSWORD;
|
|
public Account? Login(string email, string password)
|
|
{
|
|
if (Constants.MAIN_USER_ACCOUNT.Email == email && Constants.MAIN_USER_PASSWORD == password)
|
|
return Constants.MAIN_USER_ACCOUNT;
|
|
return null;
|
|
}
|
|
|
|
|
|
public Account? Register(string email, string username, string password)
|
|
{
|
|
if (email == null || username == null || password == null)
|
|
return null;
|
|
|
|
userAccount = new Account(new User(Constants.DEFAULT_ACCOUNT_IMAGE, username), email);
|
|
userPassword = password;
|
|
return userAccount;
|
|
}
|
|
}
|
|
}
|