diff --git a/pom.xml b/pom.xml
index 2551ff9e0..9439290da 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
com.uid2
uid2-operator
- 5.62.4
+ 5.62.6-alpha-270-SNAPSHOT
UTF-8
diff --git a/src/main/java/com/uid2/operator/vertx/UIDOperatorVerticle.java b/src/main/java/com/uid2/operator/vertx/UIDOperatorVerticle.java
index fd11f4882..409d36de5 100644
--- a/src/main/java/com/uid2/operator/vertx/UIDOperatorVerticle.java
+++ b/src/main/java/com/uid2/operator/vertx/UIDOperatorVerticle.java
@@ -1004,6 +1004,7 @@ private void handleTokenGenerateV2(RoutingContext rc) {
}
private Future handleLogoutAsyncV2(RoutingContext rc) {
+ LOGGER.info("handleLogoutAsyncV2 is called");
RuntimeConfig config = getConfigFromRc(rc);
IdentityEnvironment env = config.getIdentityEnvironment();
@@ -1011,6 +1012,7 @@ private Future handleLogoutAsyncV2(RoutingContext rc) {
final InputUtil.InputVal input = getTokenInputV2(req);
final String uidTraceId = rc.request().getHeader(Audit.UID_TRACE_ID_HEADER);
if (input != null && input.isValid()) {
+ LOGGER.info("input is valid");
final Instant now = Instant.now();
Promise promise = Promise.promise();
@@ -1018,6 +1020,7 @@ private Future handleLogoutAsyncV2(RoutingContext rc) {
final String phone = req == null ? null : req.getString("phone");
final String clientIp = req == null ? null : req.getString("clientIp");
+ LOGGER.info("invalidating tokens async");
this.idService.invalidateTokensAsync(input.toUserIdentity(this.identityScope, 0, now), now, uidTraceId, env,
email, phone, clientIp,
ar -> {
@@ -1026,7 +1029,10 @@ private Future handleLogoutAsyncV2(RoutingContext rc) {
body.put("optout", "OK");
ResponseUtil.SuccessV2(rc, body);
} else {
- rc.fail(500);
+ Throwable cause = ar.cause();
+ String errorMsg = cause != null ? cause.getMessage() : "Unknown error during opt-out";
+ LOGGER.error("V2 logout failed for traceId={}: {}", uidTraceId, errorMsg, cause);
+ ResponseUtil.LogErrorAndSendResponse(ResponseStatus.GenericError, 500, rc, errorMsg);
}
promise.complete();
});