fix: resolve TODO and FIXME in utils module (#220)

This commit is contained in:
Nishant Joshi
2022-12-23 00:56:09 +05:30
committed by GitHub
parent e51c7664e3
commit 87cedc296e
10 changed files with 110 additions and 129 deletions

View File

@ -618,10 +618,9 @@ pub(crate) async fn authenticate_eph_key<'a>(
.get_ephemeral_key(api_key)
.await
.change_context(errors::ApiErrorResponse::Unauthorized)?;
utils::when(
ek.customer_id.ne(&customer_id),
Err(report!(errors::ApiErrorResponse::InvalidEphermeralKey)),
)?;
utils::when(ek.customer_id.ne(&customer_id), || {
Err(report!(errors::ApiErrorResponse::InvalidEphermeralKey))
})?;
Ok(MerchantAuthentication::MerchantId(Cow::Owned(
ek.merchant_id,
)))