public bool CheckEventPassword(CheckEventPasswordDto dto) { var eventToCheck = _context.Events .Single(e => e.EventId == dto.EventId); if (eventToCheck.AudienceKey == dto.AudienceKey) { return(true); } return(false); }
public IActionResult CheckEventPassword([FromBody] CheckEventPasswordDto dto) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var isPasswordCorrect = _eventService.CheckEventPassword(dto); if (isPasswordCorrect) { return(Ok()); } return(Unauthorized()); }
public bool CheckEventPassword(CheckEventPasswordDto dto) { return(_eventRepo.CheckEventPassword(dto)); }