Esempio n. 1
0
        private LoginRAO PrepareUserRAOForLogin(GetLoginUserDTO userDTO)
        {
            byte[] passwordHash, passwordSalt;
            var    hashEngine = new CreatePasswordHashEngine();

            hashEngine.CreatePasswordHash(userDTO.Password, out passwordHash, out passwordSalt);
            var rao = _mapper.Map <LoginRAO>(userDTO);

            rao.PasswordHash = passwordHash;
            rao.PasswordSalt = passwordSalt;
            return(rao);
        }
        private UserRegisterRAO PrepareUserRAOForRegister(NewUserCreateDTO userDTO)
        {
            byte[] passwordHash, passwordSalt;
            var    hashEngine = new CreatePasswordHashEngine();

            hashEngine.CreatePasswordHash(userDTO.Password, out passwordHash, out passwordSalt);

            var rao = _mapper.Map <UserRegisterRAO>(userDTO);

            rao.PasswordHash = passwordHash;
            rao.PasswordSalt = passwordSalt;
            return(rao);
        }
Esempio n. 3
0
        // helper method
        private UserRegisterRAO PrepareUserRAOForRegister(NewUserCreateDTO userDTO)
        {
            byte[] passwordHash, passwordSalt;

            //-- Create an instance of the engine
            var hashEngine = new CreatePasswordHashEngine();

            //-- Pass userDTO variable into CreatePasswordHash method to hash the password
            hashEngine.CreatePaswordHash(userDTO.Password, out passwordHash, out passwordSalt);

            //NewUserCreateDTO = var
            //var userRAO = MapuserDTOObjectToDTO(userDTO, passwordHash, passwordSalt);

            var rao = _mapper.Map <UserRegisterRAO>(userDTO);

            rao.PasswordHash = passwordHash;
            rao.PasswordSalt = passwordSalt;

            return(rao);
        }