예제 #1
0
        private async Task CheckIfUserExsist(LoginUserQuery request)
        {
            user = await userRepository.GetByEmail(request.Email);

            if (!user.IsActive)
            {
                throw new BlogException(ErrorCode.NotFound);
            }

            var hash = encrypter.GetHash(request.Password, user.Salt);

            encrypter.CompareHash(hash, user.Hash);
        }
        private void CheckCurrentPassword(string oldPassword)
        {
            var hash = encrypter.GetHash(oldPassword, user.Salt);

            encrypter.CompareHash(hash, user.Hash);
        }