Skip to content

Commit bb2c969

Browse files
committed
disable ouath2 authentication forpayment grpc service
1 parent 6bd70a8 commit bb2c969

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

core/src/main/scala/app/softnetwork/payment/api/PaymentGrpcService.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class PaymentGrpcService(server: PaymentServer, softPayAccountDao: SoftPayAccoun
1818
override def grpcService: ActorSystem[_] => PartialFunction[HttpRequest, Future[HttpResponse]] =
1919
system => PaymentServiceApiHandler.partial(server)(system)
2020

21-
override def route: ActorSystem[_] => Route = system =>
21+
/* FIXME override def route: ActorSystem[_] => Route = system =>
2222
authenticateOAuth2Async(
2323
AccountSettings.Realm,
2424
{
@@ -44,6 +44,6 @@ class PaymentGrpcService(server: PaymentServer, softPayAccountDao: SoftPayAccoun
4444
HttpChallenges.oAuth2(AccountSettings.Realm)
4545
)
4646
)
47-
}
47+
}*/
4848

4949
}

core/src/main/scala/app/softnetwork/payment/api/PaymentServer.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,9 @@ trait PaymentServer extends PaymentServiceApi with PaymentDao {
278278
Some(bankAccount.ownerAddress),
279279
None
280280
)
281-
case _ => LoadLegalUserResponse()
281+
case _ =>
282+
log.warn(s"legal user not found for externalUuid: $externalUuid")
283+
LoadLegalUserResponse()
282284
}
283285
}
284286

core/src/main/scala/app/softnetwork/payment/handlers/SoftPayAccountDao.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ trait SoftPayAccountDao extends AccountDao with SoftPayAccountHandler {
5656
implicit val ec: ExecutionContext = system.executionContext
5757
??(token, AccountMessages.OAuthClient(token)) map {
5858
case result: AccountMessages.OAuthClientSucceededResult => Some(result.client)
59-
case _ => None
59+
case error: AccountErrorMessage =>
60+
log.error(s"oauth2 failed with token [$token] -> ${error.message}")
61+
None
62+
case _ => None
6063
}
6164
}
6265

0 commit comments

Comments
 (0)