@@ -35,7 +35,7 @@ import code.entitlement.Entitlement
3535import code .loginattempts .LoginAttempt
3636import code .metrics .APIMetrics
3737import code .metrics .MappedMetric .userId
38- import code .model .AppType
38+ import code .model .{ AppType , Consumer }
3939import code .model .dataAccess .{AuthUser , MappedBankAccount }
4040import code .regulatedentities .MappedRegulatedEntityProvider
4141import code .userlocks .UserLocksProvider
@@ -2061,9 +2061,9 @@ trait APIMethods510 {
20612061 }
20622062 )
20632063 }
2064- (consumerId , applicationText) <- consentJson.consumer_id match {
2064+ (consumerFromRequestBody : Option [ Consumer ] , applicationText) <- consentJson.consumer_id match {
20652065 case Some (id) => NewStyle .function.checkConsumerByConsumerId(id, callContext) map {
2066- c => (Some (c.consumerId.get ), c.description)
2066+ c => (Some (c), c.description)
20672067 }
20682068 case None => Future (None , " Any application" )
20692069 }
@@ -2073,7 +2073,7 @@ trait APIMethods510 {
20732073 case Props .RunModes .Test => Consent .challengeAnswerAtTestEnvironment
20742074 case _ => SecureRandomUtil .numeric()
20752075 }
2076- createdConsent <- Future (Consents .consentProvider.vend.createObpConsent(user, challengeAnswer, None )) map {
2076+ createdConsent <- Future (Consents .consentProvider.vend.createObpConsent(user, challengeAnswer, None , consumerFromRequestBody )) map {
20772077 i => connectorEmptyResponse(i, callContext)
20782078 }
20792079 consentJWT =
@@ -2082,7 +2082,7 @@ trait APIMethods510 {
20822082 consentJson,
20832083 createdConsent.secret,
20842084 createdConsent.consentId,
2085- consumerId,
2085+ consumerFromRequestBody.map(_. consumerId.get) ,
20862086 consentJson.valid_from,
20872087 consentJson.time_to_live.getOrElse(3600 ),
20882088 None ,
0 commit comments