checkInvitationParams :: Handler (Maybe ExerciseId)
checkInvitationParams = do
    mid <- (>>= parseSqlKey) <$> lookupPostParam "exercise"
    case mid of
       Nothing -> pure Nothing
       Just spId -> do
          sp <- runDB $ get404 spId
          is <- lookupPostParam "invitation-secret"
          pure $ if Just (exerciseInvitationSecret sp) == is
              then Just spId
              else Nothing
checkInvitationParams :: Handler (Maybe ExerciseId)
checkInvitationParams = do
    mid <- (>>= parseSqlKey) <$> lookupPostParam "exercise"
    case mid of
       Nothing -> pure Nothing
       Just spId -> do
          sp <- runDB $ get404 spId
          is <- lookupPostParam "invitation-secret"
          pure $ if Just (exerciseInvitationSecret sp) == is
              then Just spId
              else Nothing
checkInvitationParams = do
    mid <- (>>= parseSqlKey) <$> lookupPostParam "exercise"
    case mid of
       Nothing -> pure Nothing
       Just spId -> do
          sp <- runDB $ get404 spId
          is <- lookupPostParam "invitation-secret"
          pure $ if Just (exerciseInvitationSecret sp) == is
              then Just spId
              else Nothing