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 891f744..bd4b4e7 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(