Project_Keywi/Project.Controller/AppController.cs

22 lines
682 B
C#

using Project.Persistence;
using Project.Model;
namespace Project.Controller;
public partial class AppController
{
//save new login - hashes the password and gives it to persistence
public static void NewLoginSave(string username, string password, string email)
{
string hashedPassword = ShaHash.HashPassword(password);
var user = new NewUser(username, hashedPassword, email);
SQLite.SaveUser(user);
}
public static void CompareLogin(string username, string password)
{
string hashedPassword = ShaHash.HashPassword(password);
string Username = username;
SQLite.GetLogin(Username, hashedPassword);
}
}