From b754cc964d6b9518227e4719a781fb003f6c98a4 Mon Sep 17 00:00:00 2001 From: jgrimal Date: Thu, 31 Oct 2024 16:27:07 +0100 Subject: [PATCH] Revert "fix(credentials): move the tokenA invalidation after getCredential, because it is the one that is in the context and used during getCredential" This reverts commit 36d515430e4097fff7126a6966402ff7aeb8ec27. --- .../credentials/services/CredentialsServerService.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ocpi-toolkit-2.2.1/src/main/kotlin/com/izivia/ocpi/toolkit/modules/credentials/services/CredentialsServerService.kt b/ocpi-toolkit-2.2.1/src/main/kotlin/com/izivia/ocpi/toolkit/modules/credentials/services/CredentialsServerService.kt index 891f7449..bd4b4e74 100644 --- a/ocpi-toolkit-2.2.1/src/main/kotlin/com/izivia/ocpi/toolkit/modules/credentials/services/CredentialsServerService.kt +++ b/ocpi-toolkit-2.2.1/src/main/kotlin/com/izivia/ocpi/toolkit/modules/credentials/services/CredentialsServerService.kt @@ -61,16 +61,16 @@ open class CredentialsServerService( debugHeaders = debugHeaders, ) + // Remove token A because it is useless from now on + partnerRepository.invalidateCredentialsTokenA(partnerId = partnerId) + // Return Credentials objet to sender with the token C inside (which is for us the server token) getCredentials( serverToken = partnerRepository.saveCredentialsServerToken( partnerId = partnerId, credentialsServerToken = generateUUIDv4Token(), ), - ).also { - // Remove token A because it is useless from now on - partnerRepository.invalidateCredentialsTokenA(partnerId = partnerId) - } + ) } override suspend fun put(