|
|
@ -14,6 +14,16 @@ namespace ShoopNCook.Controllers
|
|
|
|
|
|
|
|
|
|
|
|
public void Login(string email, string password)
|
|
|
|
public void Login(string email, string password)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (email == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
UserNotifier.Notice("Please provide an email address");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (password == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
UserNotifier.Notice("Please provide your password");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
Account? acc = accounts.Login(email, password);
|
|
|
|
Account? acc = accounts.Login(email, password);
|
|
|
|
if (acc == null)
|
|
|
|
if (acc == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -25,6 +35,21 @@ namespace ShoopNCook.Controllers
|
|
|
|
|
|
|
|
|
|
|
|
public void Register(string username, string email, string password)
|
|
|
|
public void Register(string username, string email, string password)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (email == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
UserNotifier.Notice("Please provide an email address");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (password == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
UserNotifier.Notice("Please provide your password");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (username == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
UserNotifier.Notice("Please provide an username");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
Account? acc = accounts.Register(username, email, password);
|
|
|
|
Account? acc = accounts.Register(username, email, password);
|
|
|
|
if (acc == null)
|
|
|
|
if (acc == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|