public async Task <bool> Authorize(string phoneNumber, string password) { var person = await _context.Persons.FirstOrDefaultAsync(p => p.PhoneNumber.Equals(phoneNumber)); if (person == null) { throw new Exception("Person not found"); } return(SecurePasswordHasher.ValidatePassword(password, person.Password)); }