Skip to content

Commit

Permalink
Added logs to CommonService for fusionAuth.
Browse files Browse the repository at this point in the history
  • Loading branch information
chinmoy12c committed Dec 4, 2023
1 parent 2a69acb commit e4ab59c
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/main/java/com/uci/orchestrator/Service/CommonService.java
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,14 @@ public Mono<XMessage> apply(Pair<Boolean, String> result) {
from.setEncryptedDeviceID(deviceID);
xmsg.setFrom(from);
ClientResponse<UserResponse, Errors> response = botService.fusionAuthClient.retrieveUserByUsername(deviceID);
if (response.wasSuccessful() && isUserRegistered(response, appID)) {
boolean wasSuccessful = response.wasSuccessful();
boolean isUserRegistered = false;
if (wasSuccessful) {
isUserRegistered = isUserRegistered(response, appID);
}
log.info("CommonService::UpdateUser: response.wasSuccessful: " + wasSuccessful);
log.info("CommonService::UpdateUser: isUserRegistered: " + isUserRegistered);
if (wasSuccessful && isUserRegistered) {
redisCacheService.setFAUserIDForAppCache(getFACacheName(deviceID, appID), response.successResponse.user.id.toString());
return Mono.just(xmsg);
} else {
Expand Down Expand Up @@ -384,8 +391,14 @@ private String getFAUserIdForApp(String deviceID, UUID appID) {

if (userID == null || userID.isEmpty()) {
ClientResponse<UserResponse, Errors> response = botService.fusionAuthClient.retrieveUserByUsername(deviceID);

if (response.wasSuccessful() && isUserRegistered(response, appID)) {
boolean wasSuccessful = response.wasSuccessful();
boolean isUserRegistered = false;
if (wasSuccessful) {
wasSuccessful = isUserRegistered(response, appID);
}
log.info("CommonService::UpdateUser: response.wasSuccessful: " + wasSuccessful);
log.info("CommonService::UpdateUser: isUserRegistered: " + isUserRegistered);
if (wasSuccessful && isUserRegistered) {
userID = response.successResponse.user.id.toString();
redisCacheService.setFAUserIDForAppCache(getFACacheName(deviceID, appID), userID);
}
Expand Down

0 comments on commit e4ab59c

Please sign in to comment.