예제 #1
0
        public async Task <User> Login(LoginUser user)
        {
            var prof = await sqlService.FetchUser(user.EmailAddress);

            if (prof == null)
            {
                logger.LogInformation($"Account not found {user.EmailAddress}");
                return(null);
            }
            var password = PasswordHash(user.Password, prof.Salt);

            if (password != prof.Password)
            {
                logger.LogInformation($"Password mismatch {user.EmailAddress}");
                return(null);
            }

            return(prof);
        }