Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public UserWwwController(ProjectorContext db, IUserWwwManager wm)
 {
     _db = db;
     _wm = wm;
 }
Ejemplo n.º 3
0
 // 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;
 }
Ejemplo n.º 4
0
 public HomeController(ProjectorContext context)
 {
     _context = context;
 }
Ejemplo n.º 5
0
 public UserController(ProjectorContext context)
 {
     _context = context;
 }
Ejemplo n.º 6
0
 // Construct the UserFilesController using instances to it's dependencies using Dependency Injection.
 public UserFilesController(IUserFileManager fm, ProjectorContext db)
 {
     _fm = fm;
     _db = db;
 }