fixed error handling

This commit is contained in:
anhefti 2023-02-28 10:56:54 +01:00
parent b213b0a876
commit 51c375bb43

View file

@ -180,10 +180,14 @@ public class SecurityKeyServiceImpl implements SecurityKeyService {
return Cryptor
.decrypt(appSignatureKey + salt, connectionToken)
.onErrorDo(error -> {
log.warn(
"Failed to decrypt ASK with added salt value. Try to decrypt without added salt. Error: {}",
error.getMessage());
return Cryptor.decrypt(appSignatureKey, connectionToken).get();
return Cryptor
.decrypt(appSignatureKey, connectionToken)
.getOrThrow();
})
.map(signature -> createSignatureHash(signature));