Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.uid2</groupId>
<artifactId>uid2-operator</artifactId>
<version>5.62.4</version>
<version>5.62.6-alpha-270-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1004,20 +1004,23 @@ private void handleTokenGenerateV2(RoutingContext rc) {
}

private Future handleLogoutAsyncV2(RoutingContext rc) {
LOGGER.info("handleLogoutAsyncV2 is called");
RuntimeConfig config = getConfigFromRc(rc);
IdentityEnvironment env = config.getIdentityEnvironment();

final JsonObject req = (JsonObject) rc.data().get("request");
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();
final String email = req == null ? null : req.getString("email");
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 -> {
Expand All @@ -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();
});
Expand Down