Skip to content

Commit

Permalink
fix(credentials): move the tokenA invalidation after getCredential, b…
Browse files Browse the repository at this point in the history
…ecause it is the one that is in the context and used during getCredential
  • Loading branch information
jggrimal committed Oct 31, 2024
1 parent 8e9f7a8 commit 36d5154
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 36d5154

Please sign in to comment.