private async Task <User> GetIdentity(ProjectorContext userContext, string email, string password) { SHA1 sha1 = SHA1.Create(); password = GetString(sha1.ComputeHash(GetBytes(password))); //password = ToUnicode(password); var user = await userContext.User.FirstOrDefaultAsync(x => x.Email == email); if (user == null) { return(null); } if (user.Password == password) { return(user); } // Credentials are invalid, or account doesn't exist. return(null); }
public UserWwwController(ProjectorContext db, IUserWwwManager wm) { _db = db; _wm = wm; }
// Construct the UserPackagesController using instances to it's dependencies using Dependency Injection. public UserPackagesController(INpmRegistry npm, IUserPackageManager pacman, ProjectorContext db) { _npm = npm; _pacman = pacman; _db = db; }
public HomeController(ProjectorContext context) { _context = context; }
public UserController(ProjectorContext context) { _context = context; }
// Construct the UserFilesController using instances to it's dependencies using Dependency Injection. public UserFilesController(IUserFileManager fm, ProjectorContext db) { _fm = fm; _db = db; }