Example #1
0
        internal User Login(UserLoginCreds creds)
        {
            User user = _repo.GetUserByEmail(creds.Email);

            if (user == null || !BCrypt.Net.BCrypt.Verify(creds.Password, user.Hash))
            {
                throw new Exception("Invalid Email or Password");
            }
            user.Hash = null;
            return(user);
        }