From c123f6dd505ebcd9872f0fc817f18b78ae2f8c61 Mon Sep 17 00:00:00 2001 From: Neha2365 <110969715+Neha2365@users.noreply.github.com> Date: Mon, 22 Apr 2024 14:52:57 +0530 Subject: [PATCH] changes in authentication response (#1254) Signed-off-by: Neha Farheen Co-authored-by: Neha Farheen --- .../common/service/builder/AuthResponseBuilder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/builder/AuthResponseBuilder.java b/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/builder/AuthResponseBuilder.java index 65fdb07d549..4bd2a2930d9 100644 --- a/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/builder/AuthResponseBuilder.java +++ b/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/builder/AuthResponseBuilder.java @@ -119,7 +119,9 @@ public AuthResponseDTO build(String tokenID) { boolean status = !authStatusInfos.isEmpty() && authStatusInfos.stream().allMatch(AuthStatusInfo::isStatus); ResponseDTO res = new ResponseDTO(); res.setAuthStatus(status); - res.setAuthToken(tokenID); + if (status) { + res.setAuthToken(tokenID); + } responseDTO.setResponse(res); responseDTO.setResponseTime(DateUtils.getUTCCurrentDateTimeString(IdAuthCommonConstants.UTC_DATETIME_PATTERN)); AuthError[] authErrors = authStatusInfos.stream().flatMap(statusInfo -> Optional.ofNullable(statusInfo.getErr())